@spoketech/hub-client 0.1.23 → 0.1.25
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 +70 -0
- package/dist/index.d.ts +1928 -3
- package/dist/index.js +156 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2793,7 +2793,21 @@ var OrganizationMemberSourceWebhookUpsertResponseSchema = Schema2.Struct({
|
|
|
2793
2793
|
Schema2.Null
|
|
2794
2794
|
])
|
|
2795
2795
|
});
|
|
2796
|
+
var SyncProgressCount = Schema2.Int.check(Schema2.isGreaterThanOrEqualTo(0));
|
|
2797
|
+
var OnsiteAgentRunProgressSchema = Schema2.Struct({
|
|
2798
|
+
stage: Schema2.Literals(["members", "contact_preferences", "uploading", "queued_for_import"]),
|
|
2799
|
+
processingStage: Schema2.optional(
|
|
2800
|
+
Schema2.Literals(["indexing_preferences", "normalizing_members", "serializing"])
|
|
2801
|
+
),
|
|
2802
|
+
recordsProcessed: Schema2.optional(SyncProgressCount),
|
|
2803
|
+
pagesFetched: SyncProgressCount,
|
|
2804
|
+
recordsFetched: SyncProgressCount,
|
|
2805
|
+
totalPages: Schema2.Union([SyncProgressCount, Schema2.Null]),
|
|
2806
|
+
totalRecords: Schema2.Union([SyncProgressCount, Schema2.Null]),
|
|
2807
|
+
pageSize: Schema2.Union([SyncProgressCount, Schema2.Null])
|
|
2808
|
+
});
|
|
2796
2809
|
var OrganizationMemberSyncRunSummarySchema = Schema2.Struct({
|
|
2810
|
+
sourceProgress: Schema2.optional(OnsiteAgentRunProgressSchema),
|
|
2797
2811
|
totalRecords: Schema2.Number,
|
|
2798
2812
|
inserted: Schema2.Number,
|
|
2799
2813
|
updated: Schema2.Number,
|
|
@@ -3672,6 +3686,39 @@ var PresignedPostSchema = Schema2.Struct({
|
|
|
3672
3686
|
url: Schema2.String,
|
|
3673
3687
|
fields: Schema2.Record(Schema2.String, Schema2.String)
|
|
3674
3688
|
});
|
|
3689
|
+
var CreateOrganizationInitialMembershipUploadSchema = Schema2.Struct({
|
|
3690
|
+
fileName: Schema2.String.pipe(
|
|
3691
|
+
Schema2.check(Schema2.isMaxLength(255)),
|
|
3692
|
+
Schema2.check(Schema2.isPattern(/^[^/\\\p{Cc}]+\.(csv|xlsx|xls)$/iu))
|
|
3693
|
+
)
|
|
3694
|
+
});
|
|
3695
|
+
var OrganizationInitialMembershipUploadsSchema = Schema2.Struct({
|
|
3696
|
+
hasUpload: Schema2.Boolean,
|
|
3697
|
+
uploads: Schema2.Array(Schema2.Struct({
|
|
3698
|
+
uploadId: Schema2.String,
|
|
3699
|
+
fileName: Schema2.String,
|
|
3700
|
+
objectKey: Schema2.String,
|
|
3701
|
+
sizeBytes: Schema2.Number,
|
|
3702
|
+
uploadedAt: Schema2.NullOr(Schema2.String)
|
|
3703
|
+
}))
|
|
3704
|
+
});
|
|
3705
|
+
var OrganizationInitialMembershipUploadDownloadSchema = Schema2.Struct({
|
|
3706
|
+
url: Schema2.String,
|
|
3707
|
+
expiresIn: Schema2.Number
|
|
3708
|
+
});
|
|
3709
|
+
var DeleteOrganizationInitialMembershipUploadResponseSchema = Schema2.Struct({
|
|
3710
|
+
uploadId: Schema2.String,
|
|
3711
|
+
deleted: Schema2.Boolean
|
|
3712
|
+
});
|
|
3713
|
+
var CreateOrganizationInitialMembershipUploadResponseSchema = Schema2.Struct({
|
|
3714
|
+
uploadId: Schema2.String,
|
|
3715
|
+
bucketName: Schema2.String,
|
|
3716
|
+
objectKey: Schema2.String,
|
|
3717
|
+
fileName: Schema2.String,
|
|
3718
|
+
contentType: Schema2.String,
|
|
3719
|
+
expiresIn: Schema2.Number,
|
|
3720
|
+
presignedPost: PresignedPostSchema
|
|
3721
|
+
});
|
|
3675
3722
|
var CreateOrganizationMemberSourceCsvUploadResponseSchema = Schema2.Struct({
|
|
3676
3723
|
importSession: OrganizationMemberSourceCsvImportSchema,
|
|
3677
3724
|
mapping: OrganizationMemberSourceCsvMappingSchema,
|
|
@@ -4304,6 +4351,22 @@ var membersGroup = HttpApiGroup.make("members").add(
|
|
|
4304
4351
|
transform: memberListExamplesTransform
|
|
4305
4352
|
})
|
|
4306
4353
|
)
|
|
4354
|
+
).add(
|
|
4355
|
+
HttpApiEndpoint.get(
|
|
4356
|
+
"getOrganizationMemberByExternalSystemId",
|
|
4357
|
+
"/organizations/:organizationId/members/by-external-system-id/:externalSystemMemberId",
|
|
4358
|
+
{
|
|
4359
|
+
params: OrganizationSourceLookupByIdParams,
|
|
4360
|
+
query: MemberResponseModeUrlParamsSchema,
|
|
4361
|
+
success: MemberResponseSchema,
|
|
4362
|
+
error: CommonErrorSchemas
|
|
4363
|
+
}
|
|
4364
|
+
).annotateMerge(
|
|
4365
|
+
OpenApi.annotations({
|
|
4366
|
+
summary: "Get one member by external system ID for an organization",
|
|
4367
|
+
transform: memberExamplesTransform
|
|
4368
|
+
})
|
|
4369
|
+
)
|
|
4307
4370
|
).add(
|
|
4308
4371
|
HttpApiEndpoint.get(
|
|
4309
4372
|
"getOrganizationMember",
|
|
@@ -5132,6 +5195,60 @@ var memberSourcesGroup = HttpApiGroup.make("memberSources").add(
|
|
|
5132
5195
|
summary: "Create or update the CSV mapping for an organization member source"
|
|
5133
5196
|
})
|
|
5134
5197
|
)
|
|
5198
|
+
).add(
|
|
5199
|
+
HttpApiEndpoint.get(
|
|
5200
|
+
"getOrganizationInitialMembershipUploads",
|
|
5201
|
+
"/organizations/:organizationId/initial-membership-uploads",
|
|
5202
|
+
{
|
|
5203
|
+
params: OrganizationIdParams,
|
|
5204
|
+
success: OrganizationInitialMembershipUploadsSchema,
|
|
5205
|
+
error: CommonErrorSchemas
|
|
5206
|
+
}
|
|
5207
|
+
).annotateMerge(OpenApi.annotations({ summary: "Check for stored initial membership exports" }))
|
|
5208
|
+
).add(
|
|
5209
|
+
HttpApiEndpoint.get(
|
|
5210
|
+
"getOrganizationInitialMembershipUploadDownload",
|
|
5211
|
+
"/organizations/:organizationId/initial-membership-uploads/:uploadId/download",
|
|
5212
|
+
{
|
|
5213
|
+
params: Schema2.Struct({
|
|
5214
|
+
organizationId: Schema2.String,
|
|
5215
|
+
uploadId: Schema2.String.pipe(Schema2.check(Schema2.isPattern(/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i)))
|
|
5216
|
+
}),
|
|
5217
|
+
success: OrganizationInitialMembershipUploadDownloadSchema,
|
|
5218
|
+
error: CommonErrorSchemas
|
|
5219
|
+
}
|
|
5220
|
+
).annotateMerge(OpenApi.annotations({ summary: "Get a five-minute download link for an initial membership export" }))
|
|
5221
|
+
).add(
|
|
5222
|
+
HttpApiEndpoint.delete(
|
|
5223
|
+
"deleteOrganizationInitialMembershipUpload",
|
|
5224
|
+
"/organizations/:organizationId/initial-membership-uploads/:uploadId",
|
|
5225
|
+
{
|
|
5226
|
+
params: Schema2.Struct({
|
|
5227
|
+
organizationId: Schema2.String,
|
|
5228
|
+
uploadId: Schema2.String.pipe(Schema2.check(Schema2.isPattern(/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i)))
|
|
5229
|
+
}),
|
|
5230
|
+
success: DeleteOrganizationInitialMembershipUploadResponseSchema,
|
|
5231
|
+
error: CommonErrorSchemas
|
|
5232
|
+
}
|
|
5233
|
+
).annotateMerge(OpenApi.annotations({ summary: "Delete a stored initial membership export" }))
|
|
5234
|
+
).add(
|
|
5235
|
+
HttpApiEndpoint.post(
|
|
5236
|
+
"createOrganizationInitialMembershipUpload",
|
|
5237
|
+
"/organizations/:organizationId/initial-membership-uploads",
|
|
5238
|
+
{
|
|
5239
|
+
params: OrganizationIdParams,
|
|
5240
|
+
payload: CreateOrganizationInitialMembershipUploadSchema,
|
|
5241
|
+
success: CreateOrganizationInitialMembershipUploadResponseSchema.pipe(
|
|
5242
|
+
HttpApiSchema2.status(201)
|
|
5243
|
+
),
|
|
5244
|
+
error: CommonErrorSchemas
|
|
5245
|
+
}
|
|
5246
|
+
).annotateMerge(
|
|
5247
|
+
OpenApi.annotations({
|
|
5248
|
+
summary: "Stage an initial CSV or Excel membership export for later mapping and review",
|
|
5249
|
+
description: "Returns a presigned S3 POST valid for two hours, limited to 100 MiB. No member source or mapping is required. Uploading does not import members."
|
|
5250
|
+
})
|
|
5251
|
+
)
|
|
5135
5252
|
).add(
|
|
5136
5253
|
HttpApiEndpoint.post(
|
|
5137
5254
|
"createOrganizationMemberSourceCsvUpload",
|
|
@@ -5438,6 +5555,13 @@ var onsiteAgentsGroup = HttpApiGroup.make("onsiteAgents").add(
|
|
|
5438
5555
|
summary: "Issue a fresh presigned CSV upload target for a claimed onsite sync run"
|
|
5439
5556
|
})
|
|
5440
5557
|
)
|
|
5558
|
+
).add(
|
|
5559
|
+
HttpApiEndpoint.post("reportOnsiteAgentRunProgress", "/onsite-agent/runs/:runId/progress", {
|
|
5560
|
+
params: OrganizationMemberSyncRunParams,
|
|
5561
|
+
payload: OnsiteAgentRunProgressSchema,
|
|
5562
|
+
success: Schema2.Struct({ accepted: Schema2.Boolean }),
|
|
5563
|
+
error: CommonErrorSchemas
|
|
5564
|
+
})
|
|
5441
5565
|
).add(
|
|
5442
5566
|
HttpApiEndpoint.post(
|
|
5443
5567
|
"completeOnsiteAgentRun",
|
|
@@ -6365,6 +6489,15 @@ function makeSpokeClient(hubClient) {
|
|
|
6365
6489
|
query: cleanParams({ responseMode: input.responseMode })
|
|
6366
6490
|
})
|
|
6367
6491
|
),
|
|
6492
|
+
getByExternalSystemId: (input) => unwrap(
|
|
6493
|
+
hubClient.members.getOrganizationMemberByExternalSystemId({
|
|
6494
|
+
params: {
|
|
6495
|
+
organizationId: input.organizationId,
|
|
6496
|
+
externalSystemMemberId: input.externalSystemMemberId
|
|
6497
|
+
},
|
|
6498
|
+
query: cleanParams({ responseMode: input.responseMode })
|
|
6499
|
+
})
|
|
6500
|
+
),
|
|
6368
6501
|
bulkGet: (input) => unwrap(
|
|
6369
6502
|
hubClient.members.bulkGetOrganizationMembers({
|
|
6370
6503
|
params: { organizationId: input.organizationId },
|
|
@@ -6555,6 +6688,23 @@ function makeSpokeClient(hubClient) {
|
|
|
6555
6688
|
})
|
|
6556
6689
|
)
|
|
6557
6690
|
},
|
|
6691
|
+
initialMembershipUploads: {
|
|
6692
|
+
download: (input) => unwrap(
|
|
6693
|
+
hubClient.memberSources.getOrganizationInitialMembershipUploadDownload({ params: input })
|
|
6694
|
+
),
|
|
6695
|
+
get: (input) => unwrap(
|
|
6696
|
+
hubClient.memberSources.getOrganizationInitialMembershipUploads({ params: input })
|
|
6697
|
+
),
|
|
6698
|
+
delete: (input) => unwrap(
|
|
6699
|
+
hubClient.memberSources.deleteOrganizationInitialMembershipUpload({ params: input })
|
|
6700
|
+
),
|
|
6701
|
+
create: (input) => unwrap(
|
|
6702
|
+
hubClient.memberSources.createOrganizationInitialMembershipUpload({
|
|
6703
|
+
params: { organizationId: input.organizationId },
|
|
6704
|
+
payload: input.payload
|
|
6705
|
+
})
|
|
6706
|
+
)
|
|
6707
|
+
},
|
|
6558
6708
|
csvUploads: {
|
|
6559
6709
|
create: (input) => unwrap(
|
|
6560
6710
|
hubClient.memberSources.createOrganizationMemberSourceCsvUpload({
|
|
@@ -6765,6 +6915,8 @@ export {
|
|
|
6765
6915
|
ConvertOrganizationToDemoSchema,
|
|
6766
6916
|
CreateGuestSchema,
|
|
6767
6917
|
CreateMemberSchema,
|
|
6918
|
+
CreateOrganizationInitialMembershipUploadResponseSchema,
|
|
6919
|
+
CreateOrganizationInitialMembershipUploadSchema,
|
|
6768
6920
|
CreateOrganizationMemberSourceCsvUploadResponseSchema,
|
|
6769
6921
|
CreateOrganizationMemberSourceCsvUploadSchema,
|
|
6770
6922
|
CreateOrganizationPointTypeSchema,
|
|
@@ -6774,6 +6926,7 @@ export {
|
|
|
6774
6926
|
CreateServiceClientSchema,
|
|
6775
6927
|
CsvUploadReadinessSchema,
|
|
6776
6928
|
DateOnlySchema,
|
|
6929
|
+
DeleteOrganizationInitialMembershipUploadResponseSchema,
|
|
6777
6930
|
DeletePayloadSchema,
|
|
6778
6931
|
DeleteServiceClientSchema,
|
|
6779
6932
|
EnsureActiveMembershipCommandPayloadSchema,
|
|
@@ -6838,6 +6991,7 @@ export {
|
|
|
6838
6991
|
OnsiteAgentMemberPreferenceUpdateCommandSchema,
|
|
6839
6992
|
OnsiteAgentMemberRenewalCommandSchema,
|
|
6840
6993
|
OnsiteAgentMemberUpdateCommandSchema,
|
|
6994
|
+
OnsiteAgentRunProgressSchema,
|
|
6841
6995
|
OnsitePointCommandSchema,
|
|
6842
6996
|
OnsiteResourceCallRequestSchema,
|
|
6843
6997
|
OnsiteResourceCallResponseSchema,
|
|
@@ -6848,6 +7002,8 @@ export {
|
|
|
6848
7002
|
OnsiteVoucherCommandSchema,
|
|
6849
7003
|
OrganizationCapabilitiesSchema,
|
|
6850
7004
|
OrganizationCapabilitySchema,
|
|
7005
|
+
OrganizationInitialMembershipUploadDownloadSchema,
|
|
7006
|
+
OrganizationInitialMembershipUploadsSchema,
|
|
6851
7007
|
OrganizationMemberGenderSchema,
|
|
6852
7008
|
OrganizationMemberMembershipTypeSchema,
|
|
6853
7009
|
OrganizationMemberRatingGradeSchema,
|