@spoketech/hub-client 0.5.0 → 0.6.0
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 +66 -1
- package/dist/index.d.ts +715 -19
- package/dist/index.js +69 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -467,7 +467,10 @@ var organizationMemberSourceManualTransports = ["csv_bucket"];
|
|
|
467
467
|
var organizationMemberSourceLiveTransports = ["fbi"];
|
|
468
468
|
var organizationMemberSourceStatuses = ["active", "paused", "disabled"];
|
|
469
469
|
var organizationMemberSourceAgentStatuses = ["active", "paused", "disabled"];
|
|
470
|
-
var organizationMemberSourceAgentCapabilities = [
|
|
470
|
+
var organizationMemberSourceAgentCapabilities = [
|
|
471
|
+
"ensure_active_membership",
|
|
472
|
+
"ensure_active_membership_v2"
|
|
473
|
+
];
|
|
471
474
|
var organizationMemberSourceWebhookStatuses = ["active", "disabled"];
|
|
472
475
|
var organizationMemberSourceWebhookDeliveryStatuses = ["success", "failure"];
|
|
473
476
|
var organizationProductWebhookStatuses = ["active", "disabled"];
|
|
@@ -531,6 +534,7 @@ var ensureActiveMembershipOutcomes = [
|
|
|
531
534
|
"created",
|
|
532
535
|
"matched_active",
|
|
533
536
|
"renewed_existing",
|
|
537
|
+
"renewal_required",
|
|
534
538
|
"ambiguous_identity_match",
|
|
535
539
|
"unsupported_source_status",
|
|
536
540
|
"indeterminate_membership_expiry",
|
|
@@ -3250,7 +3254,9 @@ var OrganizationCapabilitiesSchema = Schema4.Struct({
|
|
|
3250
3254
|
memberCreation: Schema4.Struct({
|
|
3251
3255
|
...OrganizationCapabilitySchema.fields,
|
|
3252
3256
|
mode: Schema4.Union([Schema4.Literals(["local", "source_managed"]), Schema4.Null])
|
|
3253
|
-
})
|
|
3257
|
+
}),
|
|
3258
|
+
/** Whether `POST /members/create-requests` is available at this venue. */
|
|
3259
|
+
memberCreateRequests: OrganizationCapabilitySchema
|
|
3254
3260
|
});
|
|
3255
3261
|
var OrganizationMemberSourceSchema = Schema4.Struct({
|
|
3256
3262
|
id: Schema4.String,
|
|
@@ -3420,8 +3426,16 @@ var EnsureActiveMembershipSuccessResultSchema = Schema4.Struct({
|
|
|
3420
3426
|
var EnsureActiveMembershipNonSuccessResultSchema = Schema4.Struct({
|
|
3421
3427
|
outcome: EnsureActiveMembershipNonSuccessOutcomeSchema
|
|
3422
3428
|
});
|
|
3429
|
+
var EnsureActiveMembershipRenewalRequiredResultSchema = Schema4.Struct({
|
|
3430
|
+
outcome: Schema4.Literal("renewal_required"),
|
|
3431
|
+
memberId: Schema4.String,
|
|
3432
|
+
sourceStatus: Schema4.Literal("ACTIVE"),
|
|
3433
|
+
membershipTypeId: Schema4.String,
|
|
3434
|
+
membershipExpiry: TimestampSchema
|
|
3435
|
+
});
|
|
3423
3436
|
var EnsureActiveMembershipResultSchema = Schema4.Union([
|
|
3424
3437
|
EnsureActiveMembershipSuccessResultSchema,
|
|
3438
|
+
EnsureActiveMembershipRenewalRequiredResultSchema,
|
|
3425
3439
|
EnsureActiveMembershipNonSuccessResultSchema
|
|
3426
3440
|
]);
|
|
3427
3441
|
var PaginatedOrganizationMemberSourceCommandsSchema = Schema4.Struct({
|
|
@@ -3948,7 +3962,10 @@ var EnsureActiveMembershipOperatorReasonSchema = Schema4.String.pipe(
|
|
|
3948
3962
|
)
|
|
3949
3963
|
)
|
|
3950
3964
|
);
|
|
3965
|
+
var EnsureActiveMembershipContractVersionSchema = Schema4.Literal(2);
|
|
3951
3966
|
var EnsureActiveMembershipCommandPayloadSchema = Schema4.Struct({
|
|
3967
|
+
contractVersion: Schema4.optional(EnsureActiveMembershipContractVersionSchema),
|
|
3968
|
+
allowRenewalOnDuplicate: Schema4.optional(Schema4.Boolean),
|
|
3952
3969
|
idempotencyKey: EnsureActiveMembershipIdempotencyKeySchema,
|
|
3953
3970
|
member: EnsureActiveMembershipMemberSchema,
|
|
3954
3971
|
continuation: Schema4.optional(
|
|
@@ -4062,6 +4079,14 @@ var RequestEnsureActiveMembershipSchema = Schema4.Struct({
|
|
|
4062
4079
|
waitMs: OnsiteResourceCallWaitMsSchema,
|
|
4063
4080
|
member: EnsureActiveMembershipMemberSchema
|
|
4064
4081
|
});
|
|
4082
|
+
var RequestMemberCreationSchema = Schema4.Struct({
|
|
4083
|
+
idempotencyKey: EnsureActiveMembershipIdempotencyKeySchema,
|
|
4084
|
+
waitMs: OnsiteResourceCallWaitMsSchema,
|
|
4085
|
+
allowRenewalOnDuplicate: Schema4.optional(Schema4.Boolean).annotate({
|
|
4086
|
+
description: "Renew a verified existing membership whose paid-until date has passed. Defaults to false, which returns renewal_required without changing the membership."
|
|
4087
|
+
}),
|
|
4088
|
+
member: EnsureActiveMembershipMemberSchema
|
|
4089
|
+
});
|
|
4065
4090
|
var EnsureActiveMembershipManualReviewItemSchema = Schema4.Struct({
|
|
4066
4091
|
workflowId: Schema4.String,
|
|
4067
4092
|
commandId: Schema4.String,
|
|
@@ -4423,6 +4448,7 @@ var OnsiteAgentEnsureActiveMembershipCommandSchema = Schema4.Struct({
|
|
|
4423
4448
|
organizationId: Schema4.String,
|
|
4424
4449
|
organizationMemberSourceId: Schema4.String,
|
|
4425
4450
|
candidateSourceMemberId: Schema4.optional(Schema4.String),
|
|
4451
|
+
candidateSourceMemberIds: Schema4.optional(Schema4.Array(Schema4.String)),
|
|
4426
4452
|
vendor: Schema4.Literal("odyssey_gaming"),
|
|
4427
4453
|
connectorType: Schema4.Literal("odyssey_gaming"),
|
|
4428
4454
|
requestedAt: TimestampSchema,
|
|
@@ -4596,9 +4622,14 @@ var OnsiteAgentEnsureActiveMembershipExistingResultSchema = Schema4.Struct({
|
|
|
4596
4622
|
outcome: Schema4.Literals(["matched_active", "renewed_existing"]),
|
|
4597
4623
|
record: OnsiteAgentEnsureActiveMembershipRecordSchema
|
|
4598
4624
|
});
|
|
4625
|
+
var OnsiteAgentEnsureActiveMembershipRenewalRequiredResultSchema = Schema4.Struct({
|
|
4626
|
+
outcome: Schema4.Literal("renewal_required"),
|
|
4627
|
+
record: OnsiteAgentEnsureActiveMembershipRecordSchema
|
|
4628
|
+
});
|
|
4599
4629
|
var OnsiteAgentEnsureActiveMembershipCompletionResultSchema = Schema4.Union([
|
|
4600
4630
|
OnsiteAgentEnsureActiveMembershipCreatedResultSchema,
|
|
4601
4631
|
OnsiteAgentEnsureActiveMembershipExistingResultSchema,
|
|
4632
|
+
OnsiteAgentEnsureActiveMembershipRenewalRequiredResultSchema,
|
|
4602
4633
|
EnsureActiveMembershipNonSuccessResultSchema
|
|
4603
4634
|
]);
|
|
4604
4635
|
var OnsiteAgentCompleteEnsureActiveMembershipSchema = Schema4.Struct({
|
|
@@ -5238,6 +5269,24 @@ var membersGroup = HttpApiGroup3.make("members").add(
|
|
|
5238
5269
|
transform: ensureActiveMembershipExamplesTransform
|
|
5239
5270
|
})
|
|
5240
5271
|
)
|
|
5272
|
+
).add(
|
|
5273
|
+
HttpApiEndpoint3.post(
|
|
5274
|
+
"requestMemberCreation",
|
|
5275
|
+
"/organizations/:organizationId/members/create-requests",
|
|
5276
|
+
{
|
|
5277
|
+
params: OrganizationIdParams,
|
|
5278
|
+
payload: RequestMemberCreationSchema,
|
|
5279
|
+
success: EnsureActiveMembershipResponseSchema.pipe(
|
|
5280
|
+
HttpApiSchema2.status(202)
|
|
5281
|
+
),
|
|
5282
|
+
error: CommonErrorSchemas
|
|
5283
|
+
}
|
|
5284
|
+
).annotateMerge(
|
|
5285
|
+
OpenApi.annotations({
|
|
5286
|
+
summary: "Request creation of a member, reusing a verified existing membership",
|
|
5287
|
+
description: "Checks Hub and the venue system for an existing member before creating one. A current match is returned without changes. An expired match returns renewal_required unless allowRenewalOnDuplicate is true. Replaying the same idempotency key and request returns the same command; changing the request, including the renewal flag or rate, returns a conflict."
|
|
5288
|
+
})
|
|
5289
|
+
)
|
|
5241
5290
|
).add(
|
|
5242
5291
|
HttpApiEndpoint3.post(
|
|
5243
5292
|
"requestSourceManagedMemberRenewal",
|
|
@@ -7714,6 +7763,16 @@ function makeSpokeClient(hubClient) {
|
|
|
7714
7763
|
})
|
|
7715
7764
|
)
|
|
7716
7765
|
},
|
|
7766
|
+
/**
|
|
7767
|
+
* Requests a member, reusing a verified existing membership instead of creating a
|
|
7768
|
+
* duplicate. Expired matches return `renewal_required` unless `allowRenewalOnDuplicate`.
|
|
7769
|
+
*/
|
|
7770
|
+
requestCreation: (input) => unwrap(
|
|
7771
|
+
hubClient.members.requestMemberCreation({
|
|
7772
|
+
params: { organizationId: input.organizationId },
|
|
7773
|
+
payload: input.payload
|
|
7774
|
+
})
|
|
7775
|
+
),
|
|
7717
7776
|
sourceRequests: {
|
|
7718
7777
|
ensureActive: (input) => unwrap(
|
|
7719
7778
|
hubClient.members.ensureActiveMembership({
|
|
@@ -7891,6 +7950,11 @@ function makeSpokeClient(hubClient) {
|
|
|
7891
7950
|
params: { organizationId: input.organizationId },
|
|
7892
7951
|
query: cleanParams({ ...historyQuery(input), kind: input.kinds })
|
|
7893
7952
|
})
|
|
7953
|
+
),
|
|
7954
|
+
get: (input) => unwrap(
|
|
7955
|
+
hubClient.memberSources.getOrganizationMemberSourceCommand({
|
|
7956
|
+
params: { organizationId: input.organizationId, commandId: input.commandId }
|
|
7957
|
+
})
|
|
7894
7958
|
)
|
|
7895
7959
|
}
|
|
7896
7960
|
},
|
|
@@ -8084,12 +8148,14 @@ export {
|
|
|
8084
8148
|
DeleteServiceClientSchema,
|
|
8085
8149
|
EnsureActiveMembershipCommandPayloadSchema,
|
|
8086
8150
|
EnsureActiveMembershipCommandSchema,
|
|
8151
|
+
EnsureActiveMembershipContractVersionSchema,
|
|
8087
8152
|
EnsureActiveMembershipManualReviewItemSchema,
|
|
8088
8153
|
EnsureActiveMembershipManualReviewQueueSchema,
|
|
8089
8154
|
EnsureActiveMembershipMemberSchema,
|
|
8090
8155
|
EnsureActiveMembershipNonSuccessOutcomeSchema,
|
|
8091
8156
|
EnsureActiveMembershipNonSuccessResultSchema,
|
|
8092
8157
|
EnsureActiveMembershipOutcomeSchema,
|
|
8158
|
+
EnsureActiveMembershipRenewalRequiredResultSchema,
|
|
8093
8159
|
EnsureActiveMembershipResponseSchema,
|
|
8094
8160
|
EnsureActiveMembershipResultSchema,
|
|
8095
8161
|
EnsureActiveMembershipSuccessOutcomeSchema,
|
|
@@ -8233,6 +8299,7 @@ export {
|
|
|
8233
8299
|
PresignedPostSchema,
|
|
8234
8300
|
ReconcileEnsureActiveMembershipManualReviewSchema,
|
|
8235
8301
|
RequestEnsureActiveMembershipSchema,
|
|
8302
|
+
RequestMemberCreationSchema,
|
|
8236
8303
|
RequestPointDebitSchema,
|
|
8237
8304
|
RequestPointLookupSchema,
|
|
8238
8305
|
RequestSourceManagedMemberCreateSchema,
|