@spoketech/hub-client 0.1.9 → 0.1.11
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 +26 -2
- package/dist/index.d.ts +11656 -6561
- package/dist/index.js +309 -31
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -53,6 +53,21 @@ var organizationVoucherCommandStatuses = [
|
|
|
53
53
|
"completed",
|
|
54
54
|
"failed"
|
|
55
55
|
];
|
|
56
|
+
var organizationPointProviderProviders = ["ebet_pos"];
|
|
57
|
+
var organizationPointProviderTransports = ["onsite_client"];
|
|
58
|
+
var organizationPointProviderStatuses = ["active", "disabled"];
|
|
59
|
+
var organizationPointCommandKinds = [
|
|
60
|
+
"lookup_points",
|
|
61
|
+
"add_points",
|
|
62
|
+
"redeem_points",
|
|
63
|
+
"refund_points"
|
|
64
|
+
];
|
|
65
|
+
var organizationPointCommandStatuses = [
|
|
66
|
+
"requested",
|
|
67
|
+
"accepted",
|
|
68
|
+
"completed",
|
|
69
|
+
"failed"
|
|
70
|
+
];
|
|
56
71
|
var organizationPointTypeStatuses = ["active", "archived"];
|
|
57
72
|
var organizationMemberSyncTriggerKinds = [
|
|
58
73
|
"manual",
|
|
@@ -316,6 +331,99 @@ var CompleteOnsiteVoucherCommandSchema = Schema2.Struct({
|
|
|
316
331
|
rawRecord: Schema2.optional(Schema2.Unknown),
|
|
317
332
|
errorMessage: OptionalNullableString
|
|
318
333
|
});
|
|
334
|
+
var OrganizationPointProviderSchema = Schema2.Struct({
|
|
335
|
+
id: Schema2.String,
|
|
336
|
+
organizationId: Schema2.String,
|
|
337
|
+
provider: Schema2.Literal(...organizationPointProviderProviders),
|
|
338
|
+
transport: Schema2.Literal(...organizationPointProviderTransports),
|
|
339
|
+
status: Schema2.Literal(...organizationPointProviderStatuses),
|
|
340
|
+
config: JsonObjectSchema,
|
|
341
|
+
hasSecrets: Schema2.Boolean,
|
|
342
|
+
secretNames: Schema2.Array(Schema2.Struct({ name: Schema2.String })),
|
|
343
|
+
lastError: NullableString,
|
|
344
|
+
createdAt: TimestampSchema,
|
|
345
|
+
updatedAt: TimestampSchema,
|
|
346
|
+
deletedAt: Schema2.Union(TimestampSchema, Schema2.Null)
|
|
347
|
+
});
|
|
348
|
+
var OrganizationPointCommandResultSchema = Schema2.Struct({
|
|
349
|
+
balance: OptionalNullableNumber,
|
|
350
|
+
scaledBalance: OptionalNullableNumber,
|
|
351
|
+
memberName: OptionalNullableString,
|
|
352
|
+
memberNumber: OptionalNullableString,
|
|
353
|
+
rawResponse: Schema2.optional(Schema2.Unknown),
|
|
354
|
+
errorCode: OptionalNullableString,
|
|
355
|
+
errorType: OptionalNullableString,
|
|
356
|
+
errorMessage: OptionalNullableString,
|
|
357
|
+
gatewayMessage: OptionalNullableString,
|
|
358
|
+
gatewayPacketNumber: OptionalNullableString
|
|
359
|
+
});
|
|
360
|
+
var OrganizationPointCommandSchema = Schema2.Struct({
|
|
361
|
+
id: Schema2.String,
|
|
362
|
+
organizationId: Schema2.String,
|
|
363
|
+
organizationPointProviderId: Schema2.String,
|
|
364
|
+
serviceClientId: NullableString,
|
|
365
|
+
kind: Schema2.Literal(...organizationPointCommandKinds),
|
|
366
|
+
status: Schema2.Literal(...organizationPointCommandStatuses),
|
|
367
|
+
payload: JsonObjectSchema,
|
|
368
|
+
result: Schema2.Union(OrganizationPointCommandResultSchema, Schema2.Null),
|
|
369
|
+
errorMessage: NullableString,
|
|
370
|
+
requestedAt: TimestampSchema,
|
|
371
|
+
acceptedAt: Schema2.Union(TimestampSchema, Schema2.Null),
|
|
372
|
+
completedAt: Schema2.Union(TimestampSchema, Schema2.Null),
|
|
373
|
+
createdAt: TimestampSchema,
|
|
374
|
+
updatedAt: TimestampSchema,
|
|
375
|
+
deletedAt: Schema2.Union(TimestampSchema, Schema2.Null)
|
|
376
|
+
});
|
|
377
|
+
var UpsertOrganizationPointProviderSchema = Schema2.Struct({
|
|
378
|
+
provider: Schema2.Literal(...organizationPointProviderProviders),
|
|
379
|
+
transport: Schema2.Literal(...organizationPointProviderTransports),
|
|
380
|
+
status: Schema2.optional(Schema2.Literal(...organizationPointProviderStatuses)),
|
|
381
|
+
config: JsonObjectSchema,
|
|
382
|
+
secrets: Schema2.optional(Schema2.Array(OrganizationVoucherProviderSecretInputSchema))
|
|
383
|
+
});
|
|
384
|
+
var RequestPointLookupSchema = Schema2.Struct({
|
|
385
|
+
memberId: Schema2.optional(Schema2.String),
|
|
386
|
+
externalSystemMemberId: OptionalNullableString,
|
|
387
|
+
memberNumber: OptionalNullableString,
|
|
388
|
+
cardData: OptionalNullableString,
|
|
389
|
+
account: Schema2.optional(Schema2.Union(Schema2.String, Schema2.Number)),
|
|
390
|
+
packetNumber: Schema2.optional(Schema2.Union(Schema2.String, Schema2.Number)),
|
|
391
|
+
metadata: Schema2.optional(JsonObjectSchema)
|
|
392
|
+
});
|
|
393
|
+
var RequestPointDebitSchema = Schema2.Struct({
|
|
394
|
+
memberId: Schema2.optional(Schema2.String),
|
|
395
|
+
externalSystemMemberId: OptionalNullableString,
|
|
396
|
+
memberNumber: OptionalNullableString,
|
|
397
|
+
cardData: OptionalNullableString,
|
|
398
|
+
amount: Schema2.Number,
|
|
399
|
+
account: Schema2.optional(Schema2.Union(Schema2.String, Schema2.Number)),
|
|
400
|
+
packetNumber: Schema2.optional(Schema2.Union(Schema2.String, Schema2.Number)),
|
|
401
|
+
metadata: Schema2.optional(JsonObjectSchema)
|
|
402
|
+
});
|
|
403
|
+
var OnsitePointCommandSchema = Schema2.Struct({
|
|
404
|
+
commandId: Schema2.String,
|
|
405
|
+
organizationId: Schema2.String,
|
|
406
|
+
organizationPointProviderId: Schema2.String,
|
|
407
|
+
provider: Schema2.Literal(...organizationPointProviderProviders),
|
|
408
|
+
transport: Schema2.Literal(...organizationPointProviderTransports),
|
|
409
|
+
requestedAt: TimestampSchema,
|
|
410
|
+
kind: Schema2.Literal(...organizationPointCommandKinds),
|
|
411
|
+
payload: JsonObjectSchema,
|
|
412
|
+
config: JsonObjectSchema,
|
|
413
|
+
secrets: Schema2.Array(OrganizationVoucherProviderSecretInputSchema)
|
|
414
|
+
});
|
|
415
|
+
var CompleteOnsitePointCommandSchema = Schema2.Struct({
|
|
416
|
+
balance: OptionalNullableNumber,
|
|
417
|
+
scaledBalance: OptionalNullableNumber,
|
|
418
|
+
memberName: OptionalNullableString,
|
|
419
|
+
memberNumber: OptionalNullableString,
|
|
420
|
+
rawResponse: Schema2.optional(Schema2.Unknown),
|
|
421
|
+
errorCode: OptionalNullableString,
|
|
422
|
+
errorType: OptionalNullableString,
|
|
423
|
+
errorMessage: OptionalNullableString,
|
|
424
|
+
gatewayMessage: OptionalNullableString,
|
|
425
|
+
gatewayPacketNumber: OptionalNullableString
|
|
426
|
+
});
|
|
319
427
|
var OrganizationPointTypeSchema = Schema2.Struct({
|
|
320
428
|
id: Schema2.String,
|
|
321
429
|
organizationId: Schema2.String,
|
|
@@ -614,11 +722,7 @@ var OrganizationMembersSearchFieldSchema = Schema2.Literal(
|
|
|
614
722
|
"cardId",
|
|
615
723
|
"externalSystemMemberId"
|
|
616
724
|
);
|
|
617
|
-
var OrganizationMembersSortFieldSchema = Schema2.Literal(
|
|
618
|
-
"memberNumber",
|
|
619
|
-
"name",
|
|
620
|
-
"dob"
|
|
621
|
-
);
|
|
725
|
+
var OrganizationMembersSortFieldSchema = Schema2.Literal("memberNumber", "name", "dob");
|
|
622
726
|
var SortDirectionSchema = Schema2.Literal("asc", "desc");
|
|
623
727
|
var OrganizationMembersListUrlParamsSchema = Schema2.Struct({
|
|
624
728
|
page: optionalQueryString("1-based page number. Defaults to 1 when omitted or invalid.", {
|
|
@@ -2763,6 +2867,26 @@ var OnsiteResourceCallRequestSchema = Schema2.Union(
|
|
|
2763
2867
|
operation: Schema2.Literal("voucher.issue"),
|
|
2764
2868
|
waitMs: OnsiteResourceCallWaitMsSchema,
|
|
2765
2869
|
payload: RequestVoucherIssueSchema
|
|
2870
|
+
}),
|
|
2871
|
+
Schema2.Struct({
|
|
2872
|
+
operation: Schema2.Literal("points.lookup"),
|
|
2873
|
+
waitMs: OnsiteResourceCallWaitMsSchema,
|
|
2874
|
+
payload: RequestPointLookupSchema
|
|
2875
|
+
}),
|
|
2876
|
+
Schema2.Struct({
|
|
2877
|
+
operation: Schema2.Literal("points.add"),
|
|
2878
|
+
waitMs: OnsiteResourceCallWaitMsSchema,
|
|
2879
|
+
payload: RequestPointDebitSchema
|
|
2880
|
+
}),
|
|
2881
|
+
Schema2.Struct({
|
|
2882
|
+
operation: Schema2.Literal("points.redeem"),
|
|
2883
|
+
waitMs: OnsiteResourceCallWaitMsSchema,
|
|
2884
|
+
payload: RequestPointDebitSchema
|
|
2885
|
+
}),
|
|
2886
|
+
Schema2.Struct({
|
|
2887
|
+
operation: Schema2.Literal("points.refund"),
|
|
2888
|
+
waitMs: OnsiteResourceCallWaitMsSchema,
|
|
2889
|
+
payload: RequestPointDebitSchema
|
|
2766
2890
|
})
|
|
2767
2891
|
);
|
|
2768
2892
|
var OnsiteResourceMemberCallResponseSchema = Schema2.Struct({
|
|
@@ -2779,9 +2903,17 @@ var OnsiteResourceVoucherCallResponseSchema = Schema2.Struct({
|
|
|
2779
2903
|
timedOut: Schema2.Boolean,
|
|
2780
2904
|
command: OrganizationVoucherCommandSchema
|
|
2781
2905
|
});
|
|
2906
|
+
var OnsiteResourcePointCallResponseSchema = Schema2.Struct({
|
|
2907
|
+
kind: Schema2.Literal("points"),
|
|
2908
|
+
operation: Schema2.Literal("points.lookup", "points.add", "points.redeem", "points.refund"),
|
|
2909
|
+
settled: Schema2.Boolean,
|
|
2910
|
+
timedOut: Schema2.Boolean,
|
|
2911
|
+
command: OrganizationPointCommandSchema
|
|
2912
|
+
});
|
|
2782
2913
|
var OnsiteResourceCallResponseSchema = Schema2.Union(
|
|
2783
2914
|
OnsiteResourceMemberCallResponseSchema,
|
|
2784
|
-
OnsiteResourceVoucherCallResponseSchema
|
|
2915
|
+
OnsiteResourceVoucherCallResponseSchema,
|
|
2916
|
+
OnsiteResourcePointCallResponseSchema
|
|
2785
2917
|
);
|
|
2786
2918
|
var SourceManagedMemberUpdateCommandPayloadSchema = Schema2.Struct({
|
|
2787
2919
|
memberId: Schema2.String,
|
|
@@ -3009,10 +3141,7 @@ var OrganizationProductOptionParams = Schema2.Struct({
|
|
|
3009
3141
|
organizationProductOptionId: HttpApiSchema2.param("organizationProductOptionId", Schema2.String)
|
|
3010
3142
|
});
|
|
3011
3143
|
var OrganizationProductWebhookParams = Schema2.Struct({
|
|
3012
|
-
organizationProductWebhookId: HttpApiSchema2.param(
|
|
3013
|
-
"organizationProductWebhookId",
|
|
3014
|
-
Schema2.String
|
|
3015
|
-
)
|
|
3144
|
+
organizationProductWebhookId: HttpApiSchema2.param("organizationProductWebhookId", Schema2.String)
|
|
3016
3145
|
});
|
|
3017
3146
|
var OrganizationMemberSourceCommandParams = Schema2.Struct({
|
|
3018
3147
|
organizationId: HttpApiSchema2.param("organizationId", Schema2.String),
|
|
@@ -3081,12 +3210,9 @@ var organizationsGroup = HttpApiGroup.make("organizations").add(
|
|
|
3081
3210
|
"/organization-products/:organizationProductOptionId/webhooks"
|
|
3082
3211
|
).setPath(OrganizationProductOptionParams).setUrlParams(
|
|
3083
3212
|
Schema2.Struct({
|
|
3084
|
-
page: optionalQueryString(
|
|
3085
|
-
"1
|
|
3086
|
-
|
|
3087
|
-
example: "1"
|
|
3088
|
-
}
|
|
3089
|
-
),
|
|
3213
|
+
page: optionalQueryString("1-based page number. Defaults to 1 when omitted or invalid.", {
|
|
3214
|
+
example: "1"
|
|
3215
|
+
}),
|
|
3090
3216
|
pageSize: optionalQueryString(
|
|
3091
3217
|
"Number of organization product webhooks per page. Defaults to 25 and is capped at 100.",
|
|
3092
3218
|
{
|
|
@@ -3095,7 +3221,9 @@ var organizationsGroup = HttpApiGroup.make("organizations").add(
|
|
|
3095
3221
|
)
|
|
3096
3222
|
})
|
|
3097
3223
|
).addSuccess(PaginatedOrganizationProductWebhooksSchema).annotateContext(
|
|
3098
|
-
OpenApi.annotations({
|
|
3224
|
+
OpenApi.annotations({
|
|
3225
|
+
summary: "List configured webhooks for an organization product option"
|
|
3226
|
+
})
|
|
3099
3227
|
)
|
|
3100
3228
|
).add(
|
|
3101
3229
|
HttpApiEndpoint.post(
|
|
@@ -3126,16 +3254,12 @@ var organizationsGroup = HttpApiGroup.make("organizations").add(
|
|
|
3126
3254
|
HttpApiEndpoint.put(
|
|
3127
3255
|
"updateOrganizationProductWebhook",
|
|
3128
3256
|
"/organization-product-webhooks/:organizationProductWebhookId"
|
|
3129
|
-
).setPath(OrganizationProductWebhookParams).setPayload(UpdateOrganizationProductWebhookSchema).addSuccess(OrganizationProductWebhookUpsertResponseSchema).annotateContext(
|
|
3130
|
-
OpenApi.annotations({ summary: "Update an organization product webhook" })
|
|
3131
|
-
)
|
|
3257
|
+
).setPath(OrganizationProductWebhookParams).setPayload(UpdateOrganizationProductWebhookSchema).addSuccess(OrganizationProductWebhookUpsertResponseSchema).annotateContext(OpenApi.annotations({ summary: "Update an organization product webhook" }))
|
|
3132
3258
|
).add(
|
|
3133
3259
|
HttpApiEndpoint.del(
|
|
3134
3260
|
"deleteOrganizationProductWebhook",
|
|
3135
3261
|
"/organization-product-webhooks/:organizationProductWebhookId"
|
|
3136
|
-
).setPath(OrganizationProductWebhookParams).addSuccess(OrganizationProductWebhookSchema).annotateContext(
|
|
3137
|
-
OpenApi.annotations({ summary: "Delete an organization product webhook" })
|
|
3138
|
-
)
|
|
3262
|
+
).setPath(OrganizationProductWebhookParams).addSuccess(OrganizationProductWebhookSchema).annotateContext(OpenApi.annotations({ summary: "Delete an organization product webhook" }))
|
|
3139
3263
|
).add(
|
|
3140
3264
|
HttpApiEndpoint.get("listOrganizations", "/organizations").setUrlParams(OrganizationsListUrlParamsSchema).addSuccess(PaginatedOrganizationsSchema).annotateContext(OpenApi.annotations({ summary: "List organizations" }))
|
|
3141
3265
|
).add(
|
|
@@ -3194,7 +3318,10 @@ var membersGroup = HttpApiGroup.make("members").add(
|
|
|
3194
3318
|
})
|
|
3195
3319
|
)
|
|
3196
3320
|
).add(
|
|
3197
|
-
HttpApiEndpoint.post(
|
|
3321
|
+
HttpApiEndpoint.post(
|
|
3322
|
+
"bulkGetOrganizationMembers",
|
|
3323
|
+
"/organizations/:organizationId/members/bulk"
|
|
3324
|
+
).setPath(OrganizationIdParams).setPayload(BulkGetOrganizationMembersSchema).addSuccess(BulkOrganizationMembersResponseUnionSchema).annotateContext(
|
|
3198
3325
|
OpenApi.annotations({
|
|
3199
3326
|
summary: "Fetch up to 50 members by Spoke Hub member ID for an organization",
|
|
3200
3327
|
transform: bulkMemberExamplesTransform
|
|
@@ -3337,7 +3464,10 @@ var memberPointsGroup = HttpApiGroup.make("memberPoints").add(
|
|
|
3337
3464
|
})
|
|
3338
3465
|
)
|
|
3339
3466
|
).add(
|
|
3340
|
-
HttpApiEndpoint.post(
|
|
3467
|
+
HttpApiEndpoint.post(
|
|
3468
|
+
"createOrganizationPointType",
|
|
3469
|
+
"/organizations/:organizationId/point-types"
|
|
3470
|
+
).setPath(OrganizationIdParams).setPayload(CreateOrganizationPointTypeSchema).addSuccess(OrganizationPointTypeSchema, { status: 201 }).annotateContext(
|
|
3341
3471
|
OpenApi.annotations({
|
|
3342
3472
|
summary: "Create a point type for an organization"
|
|
3343
3473
|
})
|
|
@@ -3382,11 +3512,22 @@ var vouchersGroup = HttpApiGroup.make("vouchers").add(
|
|
|
3382
3512
|
"upsertOrganizationVoucherProvider",
|
|
3383
3513
|
"/organizations/:organizationId/voucher-provider"
|
|
3384
3514
|
).setPath(OrganizationIdParams).setPayload(UpsertOrganizationVoucherProviderSchema).addSuccess(OrganizationVoucherProviderSchema).annotateContext(
|
|
3385
|
-
OpenApi.annotations({
|
|
3515
|
+
OpenApi.annotations({
|
|
3516
|
+
summary: "Create or update the voucher provider for an organization"
|
|
3517
|
+
})
|
|
3386
3518
|
)
|
|
3387
3519
|
).add(
|
|
3388
3520
|
HttpApiEndpoint.post("requestVoucherIssue", "/organizations/:organizationId/vouchers/issue").setPath(OrganizationIdParams).setPayload(RequestVoucherIssueSchema).addSuccess(OrganizationVoucherCommandSchema, { status: 202 }).annotateContext(
|
|
3389
|
-
OpenApi.annotations({
|
|
3521
|
+
OpenApi.annotations({
|
|
3522
|
+
summary: "Request a voucher issue through the onsite voucher client"
|
|
3523
|
+
})
|
|
3524
|
+
)
|
|
3525
|
+
).add(
|
|
3526
|
+
HttpApiEndpoint.get(
|
|
3527
|
+
"getOrganizationVoucherCommand",
|
|
3528
|
+
"/organizations/:organizationId/voucher-commands/:commandId"
|
|
3529
|
+
).setPath(OrganizationVoucherCommandParams).addSuccess(OrganizationVoucherCommandSchema).annotateContext(
|
|
3530
|
+
OpenApi.annotations({ summary: "Get a specific voucher command for an organization" })
|
|
3390
3531
|
)
|
|
3391
3532
|
).add(
|
|
3392
3533
|
HttpApiEndpoint.post(
|
|
@@ -3405,14 +3546,74 @@ var vouchersGroup = HttpApiGroup.make("vouchers").add(
|
|
|
3405
3546
|
HttpApiEndpoint.post(
|
|
3406
3547
|
"completeOnsiteVoucherCommand",
|
|
3407
3548
|
"/organizations/:organizationId/onsite-voucher-commands/:commandId/complete"
|
|
3408
|
-
).setPath(OrganizationVoucherCommandParams).setPayload(CompleteOnsiteVoucherCommandSchema).addSuccess(OrganizationVoucherCommandSchema).annotateContext(
|
|
3409
|
-
|
|
3549
|
+
).setPath(OrganizationVoucherCommandParams).setPayload(CompleteOnsiteVoucherCommandSchema).addSuccess(OrganizationVoucherCommandSchema).annotateContext(OpenApi.annotations({ summary: "Complete an onsite voucher command" }))
|
|
3550
|
+
);
|
|
3551
|
+
var pointProvidersGroup = HttpApiGroup.make("pointProviders").add(
|
|
3552
|
+
HttpApiEndpoint.get(
|
|
3553
|
+
"getOrganizationPointProvider",
|
|
3554
|
+
"/organizations/:organizationId/point-provider"
|
|
3555
|
+
).setPath(OrganizationIdParams).addSuccess(Schema2.Union(OrganizationPointProviderSchema, Schema2.Null)).annotateContext(
|
|
3556
|
+
OpenApi.annotations({ summary: "Get the live points provider for an organization" })
|
|
3557
|
+
)
|
|
3558
|
+
).add(
|
|
3559
|
+
HttpApiEndpoint.put(
|
|
3560
|
+
"upsertOrganizationPointProvider",
|
|
3561
|
+
"/organizations/:organizationId/point-provider"
|
|
3562
|
+
).setPath(OrganizationIdParams).setPayload(UpsertOrganizationPointProviderSchema).addSuccess(OrganizationPointProviderSchema).annotateContext(
|
|
3563
|
+
OpenApi.annotations({
|
|
3564
|
+
summary: "Create or update the live points provider for an organization"
|
|
3565
|
+
})
|
|
3566
|
+
)
|
|
3567
|
+
).add(
|
|
3568
|
+
HttpApiEndpoint.post("requestPointLookup", "/organizations/:organizationId/points/lookup").setPath(OrganizationIdParams).setPayload(RequestPointLookupSchema).addSuccess(OrganizationPointCommandSchema, { status: 202 }).annotateContext(
|
|
3569
|
+
OpenApi.annotations({ summary: "Request a live points lookup through the onsite client" })
|
|
3570
|
+
)
|
|
3571
|
+
).add(
|
|
3572
|
+
HttpApiEndpoint.post("requestPointAdd", "/organizations/:organizationId/points/add").setPath(OrganizationIdParams).setPayload(RequestPointDebitSchema).addSuccess(OrganizationPointCommandSchema, { status: 202 }).annotateContext(
|
|
3573
|
+
OpenApi.annotations({
|
|
3574
|
+
summary: "Request a live points add through the onsite client"
|
|
3575
|
+
})
|
|
3576
|
+
)
|
|
3577
|
+
).add(
|
|
3578
|
+
HttpApiEndpoint.post("requestPointRedeem", "/organizations/:organizationId/points/redeem").setPath(OrganizationIdParams).setPayload(RequestPointDebitSchema).addSuccess(OrganizationPointCommandSchema, { status: 202 }).annotateContext(
|
|
3579
|
+
OpenApi.annotations({
|
|
3580
|
+
summary: "Request a live points redemption through the onsite client"
|
|
3581
|
+
})
|
|
3582
|
+
)
|
|
3583
|
+
).add(
|
|
3584
|
+
HttpApiEndpoint.post("requestPointRefund", "/organizations/:organizationId/points/refund").setPath(OrganizationIdParams).setPayload(RequestPointDebitSchema).addSuccess(OrganizationPointCommandSchema, { status: 202 }).annotateContext(
|
|
3585
|
+
OpenApi.annotations({ summary: "Request a live points refund through the onsite client" })
|
|
3586
|
+
)
|
|
3587
|
+
).add(
|
|
3588
|
+
HttpApiEndpoint.get(
|
|
3589
|
+
"getOrganizationPointCommand",
|
|
3590
|
+
"/organizations/:organizationId/point-commands/:commandId"
|
|
3591
|
+
).setPath(OrganizationVoucherCommandParams).addSuccess(OrganizationPointCommandSchema).annotateContext(
|
|
3592
|
+
OpenApi.annotations({ summary: "Get a specific point command for an organization" })
|
|
3593
|
+
)
|
|
3594
|
+
).add(
|
|
3595
|
+
HttpApiEndpoint.post(
|
|
3596
|
+
"pollOnsitePointCommand",
|
|
3597
|
+
"/organizations/:organizationId/onsite-point-commands/poll"
|
|
3598
|
+
).setPath(OrganizationIdParams).addSuccess(Schema2.Union(OnsitePointCommandSchema, Schema2.Null)).annotateContext(
|
|
3599
|
+
OpenApi.annotations({ summary: "Poll for the next pending onsite point command" })
|
|
3600
|
+
)
|
|
3601
|
+
).add(
|
|
3602
|
+
HttpApiEndpoint.post("pollCurrentOnsitePointCommand", "/onsite-point-commands/poll").addSuccess(Schema2.Union(OnsitePointCommandSchema, Schema2.Null)).annotateContext(
|
|
3603
|
+
OpenApi.annotations({
|
|
3604
|
+
summary: "Poll for the next pending onsite point command for the signed credential"
|
|
3605
|
+
})
|
|
3410
3606
|
)
|
|
3607
|
+
).add(
|
|
3608
|
+
HttpApiEndpoint.post(
|
|
3609
|
+
"completeOnsitePointCommand",
|
|
3610
|
+
"/organizations/:organizationId/onsite-point-commands/:commandId/complete"
|
|
3611
|
+
).setPath(OrganizationVoucherCommandParams).setPayload(CompleteOnsitePointCommandSchema).addSuccess(OrganizationPointCommandSchema).annotateContext(OpenApi.annotations({ summary: "Complete an onsite point command" }))
|
|
3411
3612
|
);
|
|
3412
3613
|
var onsiteCallsGroup = HttpApiGroup.make("onsiteCalls").add(
|
|
3413
3614
|
HttpApiEndpoint.post("callOnsiteResource", "/organizations/:organizationId/onsite-calls").setPath(OrganizationIdParams).setPayload(OnsiteResourceCallRequestSchema).addSuccess(OnsiteResourceCallResponseSchema).annotateContext(
|
|
3414
3615
|
OpenApi.annotations({
|
|
3415
|
-
summary: "Call a live onsite member or
|
|
3616
|
+
summary: "Call a live onsite member, voucher, or points resource and wait briefly for completion"
|
|
3416
3617
|
})
|
|
3417
3618
|
)
|
|
3418
3619
|
);
|
|
@@ -3700,7 +3901,7 @@ var serviceClientsGroup = HttpApiGroup.make("serviceClients").add(
|
|
|
3700
3901
|
})
|
|
3701
3902
|
)
|
|
3702
3903
|
);
|
|
3703
|
-
var HubApi = HttpApi.make("hub").add(authGroup).add(organizationsGroup).add(membersGroup).add(memberPointsGroup).add(vouchersGroup).add(onsiteCallsGroup).add(memberSourcesGroup).add(onsiteAgentsGroup).add(guestsGroup).add(serviceClientsGroup).prefix("/v1").addError(UnauthorizedErrorSchema).addError(ForbiddenErrorSchema).addError(NotFoundErrorSchema).addError(ConflictErrorSchema).addError(BadRequestErrorSchema).annotateContext(
|
|
3904
|
+
var HubApi = HttpApi.make("hub").add(authGroup).add(organizationsGroup).add(membersGroup).add(memberPointsGroup).add(vouchersGroup).add(pointProvidersGroup).add(onsiteCallsGroup).add(memberSourcesGroup).add(onsiteAgentsGroup).add(guestsGroup).add(serviceClientsGroup).prefix("/v1").addError(UnauthorizedErrorSchema).addError(ForbiddenErrorSchema).addError(NotFoundErrorSchema).addError(ConflictErrorSchema).addError(BadRequestErrorSchema).annotateContext(
|
|
3704
3905
|
OpenApi.annotations({
|
|
3705
3906
|
title: "Spoke Hub API",
|
|
3706
3907
|
version: "1.0.0",
|
|
@@ -4124,6 +4325,32 @@ function makeOnsiteResourceClient(client) {
|
|
|
4124
4325
|
operation: "voucher.issue",
|
|
4125
4326
|
payload: input.payload
|
|
4126
4327
|
})
|
|
4328
|
+
},
|
|
4329
|
+
points: {
|
|
4330
|
+
lookup: (input) => call({
|
|
4331
|
+
organizationId: input.organizationId,
|
|
4332
|
+
waitMs: input.waitMs,
|
|
4333
|
+
operation: "points.lookup",
|
|
4334
|
+
payload: input.payload
|
|
4335
|
+
}),
|
|
4336
|
+
add: (input) => call({
|
|
4337
|
+
organizationId: input.organizationId,
|
|
4338
|
+
waitMs: input.waitMs,
|
|
4339
|
+
operation: "points.add",
|
|
4340
|
+
payload: input.payload
|
|
4341
|
+
}),
|
|
4342
|
+
redeem: (input) => call({
|
|
4343
|
+
organizationId: input.organizationId,
|
|
4344
|
+
waitMs: input.waitMs,
|
|
4345
|
+
operation: "points.redeem",
|
|
4346
|
+
payload: input.payload
|
|
4347
|
+
}),
|
|
4348
|
+
refund: (input) => call({
|
|
4349
|
+
organizationId: input.organizationId,
|
|
4350
|
+
waitMs: input.waitMs,
|
|
4351
|
+
operation: "points.refund",
|
|
4352
|
+
payload: input.payload
|
|
4353
|
+
})
|
|
4127
4354
|
}
|
|
4128
4355
|
};
|
|
4129
4356
|
}
|
|
@@ -4491,6 +4718,43 @@ function makeSpokeClient(hubClient) {
|
|
|
4491
4718
|
)
|
|
4492
4719
|
}
|
|
4493
4720
|
},
|
|
4721
|
+
posPoints: {
|
|
4722
|
+
getProvider: (input) => unwrap(
|
|
4723
|
+
hubClient.pointProviders.getOrganizationPointProvider({
|
|
4724
|
+
path: { organizationId: input.organizationId }
|
|
4725
|
+
})
|
|
4726
|
+
),
|
|
4727
|
+
upsertProvider: (input) => unwrap(
|
|
4728
|
+
hubClient.pointProviders.upsertOrganizationPointProvider({
|
|
4729
|
+
path: { organizationId: input.organizationId },
|
|
4730
|
+
payload: input.payload
|
|
4731
|
+
})
|
|
4732
|
+
),
|
|
4733
|
+
requestLookup: (input) => unwrap(
|
|
4734
|
+
hubClient.pointProviders.requestPointLookup({
|
|
4735
|
+
path: { organizationId: input.organizationId },
|
|
4736
|
+
payload: input.payload
|
|
4737
|
+
})
|
|
4738
|
+
),
|
|
4739
|
+
requestAdd: (input) => unwrap(
|
|
4740
|
+
hubClient.pointProviders.requestPointAdd({
|
|
4741
|
+
path: { organizationId: input.organizationId },
|
|
4742
|
+
payload: input.payload
|
|
4743
|
+
})
|
|
4744
|
+
),
|
|
4745
|
+
requestRedeem: (input) => unwrap(
|
|
4746
|
+
hubClient.pointProviders.requestPointRedeem({
|
|
4747
|
+
path: { organizationId: input.organizationId },
|
|
4748
|
+
payload: input.payload
|
|
4749
|
+
})
|
|
4750
|
+
),
|
|
4751
|
+
requestRefund: (input) => unwrap(
|
|
4752
|
+
hubClient.pointProviders.requestPointRefund({
|
|
4753
|
+
path: { organizationId: input.organizationId },
|
|
4754
|
+
payload: input.payload
|
|
4755
|
+
})
|
|
4756
|
+
)
|
|
4757
|
+
},
|
|
4494
4758
|
vouchers: {
|
|
4495
4759
|
getProvider: (input) => unwrap(
|
|
4496
4760
|
hubClient.vouchers.getOrganizationVoucherProvider({
|
|
@@ -4574,6 +4838,7 @@ export {
|
|
|
4574
4838
|
BulkOrganizationMembersMedResponseSchema,
|
|
4575
4839
|
BulkOrganizationMembersResponseSchema,
|
|
4576
4840
|
BulkOrganizationMembersResponseUnionSchema,
|
|
4841
|
+
CompleteOnsitePointCommandSchema,
|
|
4577
4842
|
CompleteOnsiteVoucherCommandSchema,
|
|
4578
4843
|
ConflictErrorSchema,
|
|
4579
4844
|
CreateGuestSchema,
|
|
@@ -4625,9 +4890,11 @@ export {
|
|
|
4625
4890
|
OnsiteAgentMemberLookupCommandSchema,
|
|
4626
4891
|
OnsiteAgentMemberRenewalCommandSchema,
|
|
4627
4892
|
OnsiteAgentMemberUpdateCommandSchema,
|
|
4893
|
+
OnsitePointCommandSchema,
|
|
4628
4894
|
OnsiteResourceCallRequestSchema,
|
|
4629
4895
|
OnsiteResourceCallResponseSchema,
|
|
4630
4896
|
OnsiteResourceMemberCallResponseSchema,
|
|
4897
|
+
OnsiteResourcePointCallResponseSchema,
|
|
4631
4898
|
OnsiteResourceVoucherCallResponseSchema,
|
|
4632
4899
|
OnsiteVoucherCommandSchema,
|
|
4633
4900
|
OrganizationMemberGenderSchema,
|
|
@@ -4649,6 +4916,9 @@ export {
|
|
|
4649
4916
|
OrganizationMembersSortFieldSchema,
|
|
4650
4917
|
OrganizationMembersStatusFilterSchema,
|
|
4651
4918
|
OrganizationPeopleContactLookupResponseSchema,
|
|
4919
|
+
OrganizationPointCommandResultSchema,
|
|
4920
|
+
OrganizationPointCommandSchema,
|
|
4921
|
+
OrganizationPointProviderSchema,
|
|
4652
4922
|
OrganizationPointTypeSchema,
|
|
4653
4923
|
OrganizationPointTypesResponseSchema,
|
|
4654
4924
|
OrganizationProductOptionSchema,
|
|
@@ -4675,6 +4945,8 @@ export {
|
|
|
4675
4945
|
PaginatedOrganizationsSchema,
|
|
4676
4946
|
PaginatedServiceClientsSchema,
|
|
4677
4947
|
PresignedPostSchema,
|
|
4948
|
+
RequestPointDebitSchema,
|
|
4949
|
+
RequestPointLookupSchema,
|
|
4678
4950
|
RequestSourceManagedMemberCreateSchema,
|
|
4679
4951
|
RequestSourceManagedMemberRenewalSchema,
|
|
4680
4952
|
RequestSourceManagedMemberUpdateSchema,
|
|
@@ -4701,6 +4973,7 @@ export {
|
|
|
4701
4973
|
UpsertOrganizationMemberSourceCsvMappingSchema,
|
|
4702
4974
|
UpsertOrganizationMemberSourceSchema,
|
|
4703
4975
|
UpsertOrganizationMemberSourceWebhookSchema,
|
|
4976
|
+
UpsertOrganizationPointProviderSchema,
|
|
4704
4977
|
UpsertOrganizationProductWebhookSchema,
|
|
4705
4978
|
UpsertOrganizationVoucherProviderSchema,
|
|
4706
4979
|
adminRoles,
|
|
@@ -4738,6 +5011,11 @@ export {
|
|
|
4738
5011
|
organizationMemberSyncRunStatuses,
|
|
4739
5012
|
organizationMemberSyncTransports,
|
|
4740
5013
|
organizationMemberSyncTriggerKinds,
|
|
5014
|
+
organizationPointCommandKinds,
|
|
5015
|
+
organizationPointCommandStatuses,
|
|
5016
|
+
organizationPointProviderProviders,
|
|
5017
|
+
organizationPointProviderStatuses,
|
|
5018
|
+
organizationPointProviderTransports,
|
|
4741
5019
|
organizationPointTypeStatuses,
|
|
4742
5020
|
organizationProductWebhookDeliveryStatuses,
|
|
4743
5021
|
organizationProductWebhookStatuses,
|