@proveanything/smartlinks 2.2.8 → 2.2.10
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/api/bookings.d.ts +49 -2
- package/dist/api/bookings.js +59 -2
- package/dist/api/payments.d.ts +9 -0
- package/dist/api/payments.js +9 -0
- package/dist/docs/API_SUMMARY.md +108 -7
- package/dist/docs/bookings.md +539 -442
- package/dist/docs/payments.md +7 -0
- package/dist/openapi.yaml +249 -0
- package/dist/testing/bookingsMemory.d.ts +29 -1
- package/dist/testing/bookingsMemory.js +89 -1
- package/dist/testing/index.js +4 -1
- package/dist/types/appManifest.d.ts +26 -4
- package/dist/types/bookings.d.ts +99 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/API_SUMMARY.md +108 -7
- package/docs/bookings.md +539 -442
- package/docs/payments.md +7 -0
- package/openapi.yaml +249 -0
- package/package.json +87 -87
package/docs/payments.md
CHANGED
|
@@ -75,6 +75,13 @@ location.href = url
|
|
|
75
75
|
|
|
76
76
|
`shop.admin.connect` does the same thing: there is one account per business, whichever app connects it.
|
|
77
77
|
|
|
78
|
+
```typescript
|
|
79
|
+
await payments.admin.disconnect(collectionId) // → { connected: false, disconnectedAccountId }
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Disconnecting stops every app taking payments until an account is connected again. SmartLinks forgets the
|
|
83
|
+
account; the Stripe account stays the business's own, with its payments. Connecting again makes a new one.
|
|
84
|
+
|
|
78
85
|
### Reconciling an app's payments
|
|
79
86
|
|
|
80
87
|
```typescript
|
package/openapi.yaml
CHANGED
|
@@ -11163,6 +11163,32 @@ paths:
|
|
|
11163
11163
|
application/json:
|
|
11164
11164
|
schema:
|
|
11165
11165
|
$ref: "#/components/schemas/CreateBlockInput"
|
|
11166
|
+
/checkout:
|
|
11167
|
+
post:
|
|
11168
|
+
tags:
|
|
11169
|
+
- bookings
|
|
11170
|
+
summary: Book and pay.
|
|
11171
|
+
operationId: bookings_checkout
|
|
11172
|
+
security: []
|
|
11173
|
+
responses:
|
|
11174
|
+
200:
|
|
11175
|
+
description: Success
|
|
11176
|
+
content:
|
|
11177
|
+
application/json:
|
|
11178
|
+
schema:
|
|
11179
|
+
$ref: "#/components/schemas/BookingCheckoutResult"
|
|
11180
|
+
400:
|
|
11181
|
+
description: Bad request
|
|
11182
|
+
401:
|
|
11183
|
+
description: Unauthorized
|
|
11184
|
+
404:
|
|
11185
|
+
description: Not found
|
|
11186
|
+
requestBody:
|
|
11187
|
+
required: true
|
|
11188
|
+
content:
|
|
11189
|
+
application/json:
|
|
11190
|
+
schema:
|
|
11191
|
+
$ref: "#/components/schemas/BookingCheckoutInput"
|
|
11166
11192
|
/freebusy:
|
|
11167
11193
|
get:
|
|
11168
11194
|
tags:
|
|
@@ -15650,6 +15676,65 @@ paths:
|
|
|
15650
15676
|
description: Unauthorized
|
|
15651
15677
|
404:
|
|
15652
15678
|
description: Not found
|
|
15679
|
+
/{bookingId}/pay:
|
|
15680
|
+
post:
|
|
15681
|
+
tags:
|
|
15682
|
+
- bookings
|
|
15683
|
+
summary: "An approved request's pay link, for an app with its own pay page (the link in the email goes straight to Stripe)."
|
|
15684
|
+
operationId: bookings_pay
|
|
15685
|
+
security: []
|
|
15686
|
+
parameters:
|
|
15687
|
+
- name: bookingId
|
|
15688
|
+
in: path
|
|
15689
|
+
required: true
|
|
15690
|
+
schema:
|
|
15691
|
+
type: string
|
|
15692
|
+
responses:
|
|
15693
|
+
200:
|
|
15694
|
+
description: Success
|
|
15695
|
+
content:
|
|
15696
|
+
application/json:
|
|
15697
|
+
schema:
|
|
15698
|
+
$ref: "#/components/schemas/BookingPayLinkResult"
|
|
15699
|
+
400:
|
|
15700
|
+
description: Bad request
|
|
15701
|
+
401:
|
|
15702
|
+
description: Unauthorized
|
|
15703
|
+
404:
|
|
15704
|
+
description: Not found
|
|
15705
|
+
/{bookingId}/refund:
|
|
15706
|
+
post:
|
|
15707
|
+
tags:
|
|
15708
|
+
- bookings
|
|
15709
|
+
summary: "Refund a paid booking without cancelling it (admin): all that's left, or `amount` (minor units)."
|
|
15710
|
+
operationId: bookings_refund
|
|
15711
|
+
security: []
|
|
15712
|
+
parameters:
|
|
15713
|
+
- name: bookingId
|
|
15714
|
+
in: path
|
|
15715
|
+
required: true
|
|
15716
|
+
schema:
|
|
15717
|
+
type: string
|
|
15718
|
+
responses:
|
|
15719
|
+
200:
|
|
15720
|
+
description: Success
|
|
15721
|
+
content:
|
|
15722
|
+
application/json:
|
|
15723
|
+
schema:
|
|
15724
|
+
$ref: "#/components/schemas/BookingRefundResult"
|
|
15725
|
+
400:
|
|
15726
|
+
description: Bad request
|
|
15727
|
+
401:
|
|
15728
|
+
description: Unauthorized
|
|
15729
|
+
404:
|
|
15730
|
+
description: Not found
|
|
15731
|
+
requestBody:
|
|
15732
|
+
required: true
|
|
15733
|
+
content:
|
|
15734
|
+
application/json:
|
|
15735
|
+
schema:
|
|
15736
|
+
type: object
|
|
15737
|
+
additionalProperties: true
|
|
15653
15738
|
/{conditionId}:
|
|
15654
15739
|
get:
|
|
15655
15740
|
tags:
|
|
@@ -26533,6 +26618,8 @@ components:
|
|
|
26533
26618
|
$ref: "#/components/schemas/BookingAllocation"
|
|
26534
26619
|
editToken:
|
|
26535
26620
|
type: string
|
|
26621
|
+
payment:
|
|
26622
|
+
$ref: "#/components/schemas/BookingPayment"
|
|
26536
26623
|
required:
|
|
26537
26624
|
- id
|
|
26538
26625
|
- collectionId
|
|
@@ -27052,6 +27139,166 @@ components:
|
|
|
27052
27139
|
$ref: "#/components/schemas/ScheduleOverride"
|
|
27053
27140
|
required:
|
|
27054
27141
|
- timezone
|
|
27142
|
+
BookingPaymentLine:
|
|
27143
|
+
type: object
|
|
27144
|
+
properties:
|
|
27145
|
+
priceId:
|
|
27146
|
+
type: string
|
|
27147
|
+
label:
|
|
27148
|
+
type: string
|
|
27149
|
+
unitAmount:
|
|
27150
|
+
type: number
|
|
27151
|
+
quantity:
|
|
27152
|
+
type: number
|
|
27153
|
+
required:
|
|
27154
|
+
- priceId
|
|
27155
|
+
- label
|
|
27156
|
+
- unitAmount
|
|
27157
|
+
- quantity
|
|
27158
|
+
BookingPayment:
|
|
27159
|
+
type: object
|
|
27160
|
+
properties:
|
|
27161
|
+
status:
|
|
27162
|
+
type: string
|
|
27163
|
+
enum:
|
|
27164
|
+
- awaiting
|
|
27165
|
+
- paid
|
|
27166
|
+
- partially_refunded
|
|
27167
|
+
- refunded
|
|
27168
|
+
- waived
|
|
27169
|
+
total:
|
|
27170
|
+
type: number
|
|
27171
|
+
currency:
|
|
27172
|
+
type: string
|
|
27173
|
+
refunded:
|
|
27174
|
+
type: number
|
|
27175
|
+
lines:
|
|
27176
|
+
type: array
|
|
27177
|
+
items:
|
|
27178
|
+
$ref: "#/components/schemas/BookingPaymentLine"
|
|
27179
|
+
paidAt:
|
|
27180
|
+
type: string
|
|
27181
|
+
payBy:
|
|
27182
|
+
type: string
|
|
27183
|
+
requested:
|
|
27184
|
+
type: boolean
|
|
27185
|
+
link:
|
|
27186
|
+
type: string
|
|
27187
|
+
required:
|
|
27188
|
+
- status
|
|
27189
|
+
- total
|
|
27190
|
+
- currency
|
|
27191
|
+
- refunded
|
|
27192
|
+
- lines
|
|
27193
|
+
BookingPrice:
|
|
27194
|
+
type: object
|
|
27195
|
+
properties:
|
|
27196
|
+
id:
|
|
27197
|
+
type: string
|
|
27198
|
+
label:
|
|
27199
|
+
type: string
|
|
27200
|
+
amount:
|
|
27201
|
+
type: number
|
|
27202
|
+
durationMinutes:
|
|
27203
|
+
type: number
|
|
27204
|
+
resourceIds:
|
|
27205
|
+
type: array
|
|
27206
|
+
items:
|
|
27207
|
+
type: string
|
|
27208
|
+
required:
|
|
27209
|
+
- id
|
|
27210
|
+
- label
|
|
27211
|
+
- amount
|
|
27212
|
+
BookingPaymentsConfig:
|
|
27213
|
+
type: object
|
|
27214
|
+
properties:
|
|
27215
|
+
required:
|
|
27216
|
+
type: boolean
|
|
27217
|
+
currency:
|
|
27218
|
+
type: string
|
|
27219
|
+
prices:
|
|
27220
|
+
type: array
|
|
27221
|
+
items:
|
|
27222
|
+
$ref: "#/components/schemas/BookingPrice"
|
|
27223
|
+
sessionMinutes:
|
|
27224
|
+
type: number
|
|
27225
|
+
ownerCancelRefund:
|
|
27226
|
+
type: string
|
|
27227
|
+
enum:
|
|
27228
|
+
- full
|
|
27229
|
+
- none
|
|
27230
|
+
payWithinHours:
|
|
27231
|
+
type: number
|
|
27232
|
+
successUrl:
|
|
27233
|
+
type: string
|
|
27234
|
+
cancelUrl:
|
|
27235
|
+
type: string
|
|
27236
|
+
allowedHosts:
|
|
27237
|
+
type: array
|
|
27238
|
+
items:
|
|
27239
|
+
type: string
|
|
27240
|
+
BookingPriceLine:
|
|
27241
|
+
type: object
|
|
27242
|
+
properties:
|
|
27243
|
+
priceId:
|
|
27244
|
+
type: string
|
|
27245
|
+
quantity:
|
|
27246
|
+
type: number
|
|
27247
|
+
required:
|
|
27248
|
+
- priceId
|
|
27249
|
+
BookingCheckoutInput:
|
|
27250
|
+
type: object
|
|
27251
|
+
properties:
|
|
27252
|
+
lines:
|
|
27253
|
+
type: array
|
|
27254
|
+
items:
|
|
27255
|
+
$ref: "#/components/schemas/BookingPriceLine"
|
|
27256
|
+
priceId:
|
|
27257
|
+
type: string
|
|
27258
|
+
email:
|
|
27259
|
+
type: string
|
|
27260
|
+
successUrl:
|
|
27261
|
+
type: string
|
|
27262
|
+
cancelUrl:
|
|
27263
|
+
type: string
|
|
27264
|
+
customer:
|
|
27265
|
+
type: object
|
|
27266
|
+
additionalProperties: true
|
|
27267
|
+
BookingCheckoutResult:
|
|
27268
|
+
type: object
|
|
27269
|
+
properties:
|
|
27270
|
+
booking:
|
|
27271
|
+
$ref: "#/components/schemas/Booking"
|
|
27272
|
+
editToken:
|
|
27273
|
+
type: string
|
|
27274
|
+
checkoutUrl:
|
|
27275
|
+
type: string
|
|
27276
|
+
expiresAt:
|
|
27277
|
+
type: string
|
|
27278
|
+
total:
|
|
27279
|
+
type: number
|
|
27280
|
+
currency:
|
|
27281
|
+
type: string
|
|
27282
|
+
request:
|
|
27283
|
+
type: boolean
|
|
27284
|
+
required:
|
|
27285
|
+
- booking
|
|
27286
|
+
- checkoutUrl
|
|
27287
|
+
- expiresAt
|
|
27288
|
+
- total
|
|
27289
|
+
- currency
|
|
27290
|
+
BookingPayLinkResult:
|
|
27291
|
+
type: object
|
|
27292
|
+
properties:
|
|
27293
|
+
checkoutUrl:
|
|
27294
|
+
type: string
|
|
27295
|
+
done:
|
|
27296
|
+
type: string
|
|
27297
|
+
enum:
|
|
27298
|
+
- paid
|
|
27299
|
+
- closed
|
|
27300
|
+
url:
|
|
27301
|
+
type: string
|
|
27055
27302
|
BookingResourceRef:
|
|
27056
27303
|
type: object
|
|
27057
27304
|
properties:
|
|
@@ -27114,6 +27361,8 @@ components:
|
|
|
27114
27361
|
- fri
|
|
27115
27362
|
- sat
|
|
27116
27363
|
- sun
|
|
27364
|
+
BookingRefundResult:
|
|
27365
|
+
$ref: "#/components/schemas/Booking"
|
|
27117
27366
|
ListBroadcastsQuery:
|
|
27118
27367
|
type: object
|
|
27119
27368
|
properties:
|
package/package.json
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@proveanything/smartlinks",
|
|
3
|
-
"version": "2.2.
|
|
4
|
-
"description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"types": "dist/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"import": "./dist/index.js",
|
|
12
|
-
"default": "./dist/index.js"
|
|
13
|
-
},
|
|
14
|
-
"./testing": {
|
|
15
|
-
"types": "./dist/testing/index.d.ts",
|
|
16
|
-
"import": "./dist/testing/index.js",
|
|
17
|
-
"default": "./dist/testing/index.js"
|
|
18
|
-
},
|
|
19
|
-
"./*": {
|
|
20
|
-
"types": "./dist/*.d.ts",
|
|
21
|
-
"import": "./dist/*.js",
|
|
22
|
-
"default": "./dist/*.js"
|
|
23
|
-
},
|
|
24
|
-
"./baseline.css": "./dist/baseline.css",
|
|
25
|
-
"./baseline.classes.json": "./dist/baseline.classes.json",
|
|
26
|
-
"./theme.css": "./dist/theme.css",
|
|
27
|
-
"./theme-boot.js": "./dist/theme-boot.js",
|
|
28
|
-
"./package.json": "./package.json"
|
|
29
|
-
},
|
|
30
|
-
"bin": {
|
|
31
|
-
"smartlinks-register-release": "scripts/register-release.mjs",
|
|
32
|
-
"smartlinks-publish": "scripts/publish.mjs",
|
|
33
|
-
"smartlinks-doctor": "scripts/doctor.mjs",
|
|
34
|
-
"smartlinks-headless": "scripts/headless-check.mjs"
|
|
35
|
-
},
|
|
36
|
-
"files": [
|
|
37
|
-
"dist/",
|
|
38
|
-
"docs/",
|
|
39
|
-
"scripts/register-release.mjs",
|
|
40
|
-
"scripts/publish.mjs",
|
|
41
|
-
"scripts/doctor.mjs",
|
|
42
|
-
"scripts/headless-check.mjs",
|
|
43
|
-
"scripts/lib/",
|
|
44
|
-
"openapi.yaml",
|
|
45
|
-
"README.md"
|
|
46
|
-
],
|
|
47
|
-
"scripts": {
|
|
48
|
-
"test": "node test/run.cjs",
|
|
49
|
-
"build": "node scripts/write-version.mjs && tsc && node scripts/fix-esm-extensions.mjs && node generate-api-summary.cjs && node generate-openapi.cjs && node scripts/copy-docs-to-dist.cjs && node scripts/build-baseline.mjs",
|
|
50
|
-
"docs": "typedoc",
|
|
51
|
-
"docs:summary": "node generate-api-summary.cjs",
|
|
52
|
-
"docs:openapi": "node generate-openapi.cjs",
|
|
53
|
-
"docs:openapi:lint": "npx --yes @redocly/cli@latest lint openapi.yaml",
|
|
54
|
-
"docs:openapi:check": "node generate-openapi.cjs && npx --yes @redocly/cli@latest lint openapi.yaml",
|
|
55
|
-
"build:docs": "tsc build-docs.ts --outDir dist && node dist/build-docs.js",
|
|
56
|
-
"prepublishOnly": "npm run build"
|
|
57
|
-
},
|
|
58
|
-
"keywords": [
|
|
59
|
-
"smartlinks",
|
|
60
|
-
"api",
|
|
61
|
-
"authentication",
|
|
62
|
-
"traceability",
|
|
63
|
-
"blockchain",
|
|
64
|
-
"typescript",
|
|
65
|
-
"sdk"
|
|
66
|
-
],
|
|
67
|
-
"author": "Glenn Shoosmith",
|
|
68
|
-
"license": "MIT",
|
|
69
|
-
"publishConfig": {
|
|
70
|
-
"access": "public"
|
|
71
|
-
},
|
|
72
|
-
"dependencies": {
|
|
73
|
-
"cross-fetch": "^3.1.5",
|
|
74
|
-
"es-module-lexer": "^1.7.0"
|
|
75
|
-
},
|
|
76
|
-
"devDependencies": {
|
|
77
|
-
"ts-node": "^10.9.1",
|
|
78
|
-
"typedoc": "^0.25.13",
|
|
79
|
-
"typedoc-plugin-markdown": "^3.17.1",
|
|
80
|
-
"typescript": "^4.9.0"
|
|
81
|
-
},
|
|
82
|
-
"repository": {
|
|
83
|
-
"type": "git",
|
|
84
|
-
"url": "https://github.com/Prove-Anything/smartlinks.git"
|
|
85
|
-
},
|
|
86
|
-
"homepage": "https://smartlinks.app"
|
|
87
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@proveanything/smartlinks",
|
|
3
|
+
"version": "2.2.10",
|
|
4
|
+
"description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./testing": {
|
|
15
|
+
"types": "./dist/testing/index.d.ts",
|
|
16
|
+
"import": "./dist/testing/index.js",
|
|
17
|
+
"default": "./dist/testing/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./*": {
|
|
20
|
+
"types": "./dist/*.d.ts",
|
|
21
|
+
"import": "./dist/*.js",
|
|
22
|
+
"default": "./dist/*.js"
|
|
23
|
+
},
|
|
24
|
+
"./baseline.css": "./dist/baseline.css",
|
|
25
|
+
"./baseline.classes.json": "./dist/baseline.classes.json",
|
|
26
|
+
"./theme.css": "./dist/theme.css",
|
|
27
|
+
"./theme-boot.js": "./dist/theme-boot.js",
|
|
28
|
+
"./package.json": "./package.json"
|
|
29
|
+
},
|
|
30
|
+
"bin": {
|
|
31
|
+
"smartlinks-register-release": "scripts/register-release.mjs",
|
|
32
|
+
"smartlinks-publish": "scripts/publish.mjs",
|
|
33
|
+
"smartlinks-doctor": "scripts/doctor.mjs",
|
|
34
|
+
"smartlinks-headless": "scripts/headless-check.mjs"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist/",
|
|
38
|
+
"docs/",
|
|
39
|
+
"scripts/register-release.mjs",
|
|
40
|
+
"scripts/publish.mjs",
|
|
41
|
+
"scripts/doctor.mjs",
|
|
42
|
+
"scripts/headless-check.mjs",
|
|
43
|
+
"scripts/lib/",
|
|
44
|
+
"openapi.yaml",
|
|
45
|
+
"README.md"
|
|
46
|
+
],
|
|
47
|
+
"scripts": {
|
|
48
|
+
"test": "node test/run.cjs",
|
|
49
|
+
"build": "node scripts/write-version.mjs && tsc && node scripts/fix-esm-extensions.mjs && node generate-api-summary.cjs && node generate-openapi.cjs && node scripts/copy-docs-to-dist.cjs && node scripts/build-baseline.mjs",
|
|
50
|
+
"docs": "typedoc",
|
|
51
|
+
"docs:summary": "node generate-api-summary.cjs",
|
|
52
|
+
"docs:openapi": "node generate-openapi.cjs",
|
|
53
|
+
"docs:openapi:lint": "npx --yes @redocly/cli@latest lint openapi.yaml",
|
|
54
|
+
"docs:openapi:check": "node generate-openapi.cjs && npx --yes @redocly/cli@latest lint openapi.yaml",
|
|
55
|
+
"build:docs": "tsc build-docs.ts --outDir dist && node dist/build-docs.js",
|
|
56
|
+
"prepublishOnly": "npm run build"
|
|
57
|
+
},
|
|
58
|
+
"keywords": [
|
|
59
|
+
"smartlinks",
|
|
60
|
+
"api",
|
|
61
|
+
"authentication",
|
|
62
|
+
"traceability",
|
|
63
|
+
"blockchain",
|
|
64
|
+
"typescript",
|
|
65
|
+
"sdk"
|
|
66
|
+
],
|
|
67
|
+
"author": "Glenn Shoosmith",
|
|
68
|
+
"license": "MIT",
|
|
69
|
+
"publishConfig": {
|
|
70
|
+
"access": "public"
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {
|
|
73
|
+
"cross-fetch": "^3.1.5",
|
|
74
|
+
"es-module-lexer": "^1.7.0"
|
|
75
|
+
},
|
|
76
|
+
"devDependencies": {
|
|
77
|
+
"ts-node": "^10.9.1",
|
|
78
|
+
"typedoc": "^0.25.13",
|
|
79
|
+
"typedoc-plugin-markdown": "^3.17.1",
|
|
80
|
+
"typescript": "^4.9.0"
|
|
81
|
+
},
|
|
82
|
+
"repository": {
|
|
83
|
+
"type": "git",
|
|
84
|
+
"url": "https://github.com/Prove-Anything/smartlinks.git"
|
|
85
|
+
},
|
|
86
|
+
"homepage": "https://smartlinks.app"
|
|
87
|
+
}
|