@proveanything/smartlinks 2.0.55 → 2.0.57

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/openapi.yaml CHANGED
@@ -123,7 +123,7 @@ paths:
123
123
  get:
124
124
  tags:
125
125
  - realtime
126
- summary: Get an Ably token for admin real-time communication.
126
+ summary: (subscribe only).
127
127
  operationId: realtime_getAdminToken
128
128
  security:
129
129
  - bearerAuth: []
@@ -13960,7 +13960,7 @@ paths:
13960
13960
  get:
13961
13961
  tags:
13962
13962
  - realtime
13963
- summary: realtime.getPublicToken
13963
+ summary: "`collection:{collectionId}:*` (subscribe; publish only for the collection's admins)."
13964
13964
  operationId: realtime_getPublicToken
13965
13965
  security: []
13966
13966
  parameters:
@@ -14018,6 +14018,33 @@ paths:
14018
14018
  description: Unauthorized
14019
14019
  404:
14020
14020
  description: Not found
14021
+ /public/realtime/publish:
14022
+ post:
14023
+ tags:
14024
+ - realtime
14025
+ summary: "One of your app's declared channels (manifest `realtime.channels`)."
14026
+ operationId: realtime_channel
14027
+ security: []
14028
+ responses:
14029
+ 200:
14030
+ description: Success
14031
+ content:
14032
+ application/json:
14033
+ schema:
14034
+ type: object
14035
+ additionalProperties: true
14036
+ 400:
14037
+ description: Bad request
14038
+ 401:
14039
+ description: Unauthorized
14040
+ 404:
14041
+ description: Not found
14042
+ requestBody:
14043
+ required: true
14044
+ content:
14045
+ application/json:
14046
+ schema:
14047
+ $ref: "#/components/schemas/RealtimeScope"
14021
14048
  /public/tags/{tagId}:
14022
14049
  get:
14023
14050
  tags:
@@ -19618,10 +19645,15 @@ components:
19618
19645
  $ref: "#/components/schemas/AppManifestExecutor"
19619
19646
  functions:
19620
19647
  $ref: "#/components/schemas/AppManifestFunctions"
19648
+ realtime:
19649
+ type: object
19650
+ additionalProperties: true
19621
19651
  data:
19622
19652
  $ref: "#/components/schemas/AppDataDeclaration"
19623
19653
  headless:
19624
19654
  $ref: "#/components/schemas/AppHeadlessDeclaration"
19655
+ connector:
19656
+ $ref: "#/components/schemas/AppConnectorDeclaration"
19625
19657
  required:
19626
19658
  - name
19627
19659
  - version
@@ -19629,6 +19661,268 @@ components:
19629
19661
  - function
19630
19662
  - files
19631
19663
  - components
19664
+ ConnectorConnectionField:
19665
+ type: object
19666
+ properties:
19667
+ name:
19668
+ type: string
19669
+ label:
19670
+ type: string
19671
+ description:
19672
+ type: string
19673
+ secret:
19674
+ type: string
19675
+ required:
19676
+ type: boolean
19677
+ type:
19678
+ type: string
19679
+ enum:
19680
+ - text
19681
+ - url
19682
+ - select
19683
+ - number
19684
+ - boolean
19685
+ options:
19686
+ type: array
19687
+ items:
19688
+ type: object
19689
+ additionalProperties: true
19690
+ placeholder:
19691
+ type: string
19692
+ required:
19693
+ - name
19694
+ - label
19695
+ ConnectorPreset:
19696
+ type: object
19697
+ properties:
19698
+ id:
19699
+ type: string
19700
+ title:
19701
+ type: string
19702
+ description:
19703
+ type: string
19704
+ direction:
19705
+ type: string
19706
+ enum:
19707
+ - inbound
19708
+ - outbound
19709
+ entity:
19710
+ type: string
19711
+ flow:
19712
+ type: object
19713
+ additionalProperties: true
19714
+ required:
19715
+ - id
19716
+ - title
19717
+ - direction
19718
+ - entity
19719
+ ConnectorPanel:
19720
+ type: object
19721
+ properties:
19722
+ id:
19723
+ type: string
19724
+ title:
19725
+ type: string
19726
+ component:
19727
+ type: string
19728
+ required:
19729
+ - id
19730
+ - title
19731
+ - component
19732
+ AppConnectorDeclaration:
19733
+ type: object
19734
+ properties:
19735
+ provider:
19736
+ type: string
19737
+ title:
19738
+ type: string
19739
+ directions:
19740
+ type: array
19741
+ items:
19742
+ type: string
19743
+ enum:
19744
+ - inbound
19745
+ - outbound
19746
+ entities:
19747
+ type: array
19748
+ items:
19749
+ type: string
19750
+ connection:
19751
+ type: object
19752
+ additionalProperties: true
19753
+ settings:
19754
+ type: object
19755
+ additionalProperties: true
19756
+ presets:
19757
+ type: array
19758
+ items:
19759
+ $ref: "#/components/schemas/ConnectorPreset"
19760
+ functions:
19761
+ type: object
19762
+ additionalProperties: true
19763
+ testConnection:
19764
+ type: string
19765
+ describeTarget:
19766
+ type: string
19767
+ sample:
19768
+ type: string
19769
+ transform:
19770
+ type: string
19771
+ send:
19772
+ type: string
19773
+ fetch:
19774
+ type: string
19775
+ panels:
19776
+ type: array
19777
+ items:
19778
+ $ref: "#/components/schemas/ConnectorPanel"
19779
+ aiGuide:
19780
+ type: string
19781
+ required:
19782
+ - provider
19783
+ - directions
19784
+ - entities
19785
+ - functions
19786
+ ConnectorInstallation:
19787
+ type: object
19788
+ properties:
19789
+ collectionId:
19790
+ type: string
19791
+ appId:
19792
+ type: string
19793
+ flowId:
19794
+ type: string
19795
+ connection:
19796
+ type: object
19797
+ additionalProperties: true
19798
+ settings:
19799
+ type: object
19800
+ additionalProperties: true
19801
+ required:
19802
+ - collectionId
19803
+ - appId
19804
+ - connection
19805
+ - settings
19806
+ ConnectorTestResult:
19807
+ type: object
19808
+ properties:
19809
+ ok:
19810
+ type: boolean
19811
+ message:
19812
+ type: string
19813
+ required:
19814
+ - ok
19815
+ - message
19816
+ ConnectorTargetField:
19817
+ type: object
19818
+ properties:
19819
+ path:
19820
+ type: string
19821
+ label:
19822
+ type: string
19823
+ type:
19824
+ type: string
19825
+ enum:
19826
+ - string
19827
+ - number
19828
+ - boolean
19829
+ - date
19830
+ - object
19831
+ - array
19832
+ required:
19833
+ type: boolean
19834
+ description:
19835
+ type: string
19836
+ enum:
19837
+ type: array
19838
+ items:
19839
+ type: string
19840
+ required:
19841
+ - path
19842
+ ConnectorTargetSchema:
19843
+ type: object
19844
+ properties:
19845
+ fields:
19846
+ type: array
19847
+ items:
19848
+ $ref: "#/components/schemas/ConnectorTargetField"
19849
+ required:
19850
+ - fields
19851
+ ConnectorRecords:
19852
+ type: object
19853
+ properties:
19854
+ records:
19855
+ type: array
19856
+ items:
19857
+ type: object
19858
+ additionalProperties: true
19859
+ nextCursor:
19860
+ type: string
19861
+ required:
19862
+ - records
19863
+ ConnectorTransformInput:
19864
+ type: object
19865
+ properties:
19866
+ installation:
19867
+ $ref: "#/components/schemas/ConnectorInstallation"
19868
+ records:
19869
+ type: array
19870
+ items:
19871
+ type: object
19872
+ additionalProperties: true
19873
+ mapping:
19874
+ type: array
19875
+ items:
19876
+ $ref: "#/components/schemas/FieldMapping"
19877
+ required:
19878
+ - installation
19879
+ - records
19880
+ - mapping
19881
+ ConnectorTransformResult:
19882
+ type: object
19883
+ properties:
19884
+ payloads:
19885
+ type: array
19886
+ items: {}
19887
+ skipped:
19888
+ type: array
19889
+ items:
19890
+ type: object
19891
+ additionalProperties: true
19892
+ required:
19893
+ - payloads
19894
+ ConnectorSendInput:
19895
+ type: object
19896
+ properties:
19897
+ installation:
19898
+ $ref: "#/components/schemas/ConnectorInstallation"
19899
+ payloads:
19900
+ type: array
19901
+ items: {}
19902
+ required:
19903
+ - installation
19904
+ - payloads
19905
+ ConnectorSendResult:
19906
+ type: object
19907
+ properties:
19908
+ results:
19909
+ type: array
19910
+ items:
19911
+ type: object
19912
+ additionalProperties: true
19913
+ required:
19914
+ - results
19915
+ ConnectorFetchInput:
19916
+ type: object
19917
+ properties:
19918
+ installation:
19919
+ $ref: "#/components/schemas/ConnectorInstallation"
19920
+ cursor:
19921
+ type: string
19922
+ limit:
19923
+ type: number
19924
+ required:
19925
+ - installation
19632
19926
  CollectionAppWidget:
19633
19927
  type: object
19634
19928
  properties:
@@ -25883,6 +26177,18 @@ components:
25883
26177
  type: string
25884
26178
  auth:
25885
26179
  $ref: "#/components/schemas/FlowConnectionAuth"
26180
+ FlowConnectorRef:
26181
+ type: object
26182
+ properties:
26183
+ appId:
26184
+ type: string
26185
+ preset:
26186
+ type: string
26187
+ settings:
26188
+ type: object
26189
+ additionalProperties: true
26190
+ required:
26191
+ - appId
25886
26192
  IntegrationFlowConfig:
25887
26193
  type: object
25888
26194
  properties:
@@ -25892,6 +26198,8 @@ components:
25892
26198
  type: array
25893
26199
  items:
25894
26200
  $ref: "#/components/schemas/FieldMapping"
26201
+ connector:
26202
+ $ref: "#/components/schemas/FlowConnectorRef"
25895
26203
  IntegrationFlow:
25896
26204
  type: object
25897
26205
  properties:
@@ -26024,6 +26332,12 @@ components:
26024
26332
  type: number
26025
26333
  failed:
26026
26334
  type: number
26335
+ created:
26336
+ type: number
26337
+ updated:
26338
+ type: number
26339
+ skipped:
26340
+ type: number
26027
26341
  status:
26028
26342
  $ref: "#/components/schemas/RunStatus"
26029
26343
  runId:
@@ -26032,9 +26346,47 @@ components:
26032
26346
  - flowId
26033
26347
  - direction
26034
26348
  - records
26035
- - sent
26036
26349
  - failed
26037
26350
  - status
26351
+ InstalledConnector:
26352
+ type: object
26353
+ properties:
26354
+ appId:
26355
+ type: string
26356
+ name:
26357
+ type: string
26358
+ channel:
26359
+ type: string
26360
+ version:
26361
+ type: string
26362
+ connector:
26363
+ type: object
26364
+ additionalProperties: true
26365
+ installation:
26366
+ type: object
26367
+ additionalProperties: true
26368
+ secrets:
26369
+ type: object
26370
+ additionalProperties:
26371
+ type: object
26372
+ additionalProperties: true
26373
+ required:
26374
+ - appId
26375
+ - name
26376
+ - channel
26377
+ - version
26378
+ - connector
26379
+ - installation
26380
+ - secrets
26381
+ SaveConnectorInstallationInput:
26382
+ type: object
26383
+ properties:
26384
+ connection:
26385
+ type: object
26386
+ additionalProperties: true
26387
+ settings:
26388
+ type: object
26389
+ additionalProperties: true
26038
26390
  CapturedRequest:
26039
26391
  type: object
26040
26392
  properties:
@@ -26376,6 +26728,13 @@ components:
26376
26728
  - none
26377
26729
  UpdateFlowInput:
26378
26730
  $ref: "#/components/schemas/CreateFlowInput"
26731
+ ConnectorConsoleStep:
26732
+ type: string
26733
+ enum:
26734
+ - testConnection
26735
+ - describeTarget
26736
+ - sample
26737
+ - transform
26379
26738
  RunTrigger:
26380
26739
  type: string
26381
26740
  enum:
@@ -29830,6 +30189,79 @@ components:
29830
30189
  - nonce
29831
30190
  - mac
29832
30191
  - clientId
30192
+ RealtimeScope:
30193
+ type: object
30194
+ properties:
30195
+ collectionId:
30196
+ type: string
30197
+ appId:
30198
+ type: string
30199
+ required:
30200
+ - collectionId
30201
+ RealtimeMessage:
30202
+ type: object
30203
+ properties:
30204
+ channel:
30205
+ type: string
30206
+ event:
30207
+ type: string
30208
+ data: {}
30209
+ at:
30210
+ type: number
30211
+ required:
30212
+ - channel
30213
+ - event
30214
+ - data
30215
+ RealtimeChangeEvent:
30216
+ type: object
30217
+ properties:
30218
+ type:
30219
+ type: string
30220
+ id:
30221
+ type: string
30222
+ appId:
30223
+ type: string
30224
+ recordType:
30225
+ type: string
30226
+ productId:
30227
+ type: string
30228
+ proofId:
30229
+ type: string
30230
+ status:
30231
+ type: string
30232
+ at:
30233
+ type: number
30234
+ required:
30235
+ - type
30236
+ - at
30237
+ RealtimeChangeFilter:
30238
+ type: object
30239
+ properties:
30240
+ type:
30241
+ type: string
30242
+ id:
30243
+ type: string
30244
+ appId:
30245
+ type: string
30246
+ recordType:
30247
+ type: string
30248
+ productId:
30249
+ type: string
30250
+ proofId:
30251
+ type: string
30252
+ RealtimeChannelDeclaration:
30253
+ type: object
30254
+ properties:
30255
+ name:
30256
+ type: string
30257
+ subscribe:
30258
+ type: object
30259
+ additionalProperties: true
30260
+ publish:
30261
+ type: object
30262
+ additionalProperties: true
30263
+ required:
30264
+ - name
29833
30265
  RealtimeChannelPattern:
29834
30266
  type: string
29835
30267
  ResearchFetchRequest:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "2.0.55",
3
+ "version": "2.0.57",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -313,6 +313,31 @@ if (meta.respectsHostTheme) {
313
313
  if (embeds && !handRolled.length && !blocked.size) console.log(`${GREEN}✓${RESET} embedded widgets ${DIM}— ${embeds} via the host's EmbeddedWidget${RESET}`);
314
314
  }
315
315
 
316
+ // ---- realtime: SL.realtime, never a provider library or key in the app ---------------------------
317
+ // SmartLinks Realtime (docs/realtime.md) hands out the stream and checks every publish; an app that talks
318
+ // to the provider directly bypasses the channel rules (and a provider key in a bundle is a key for all).
319
+ {
320
+ const EXT = /\.(tsx|ts|jsx|js)$/;
321
+ const SKIP = new Set(['node_modules', 'dist', '.git', 'public']);
322
+ const hitsRt = [];
323
+ (function walkRt(dir) {
324
+ let entries = [];
325
+ try { entries = readdirSync(dir, { withFileTypes: true }); } catch { return; }
326
+ for (const e of entries) {
327
+ if (e.isDirectory()) { if (!SKIP.has(e.name)) walkRt(join(dir, e.name)); }
328
+ else if (EXT.test(e.name)) {
329
+ const f = join(dir, e.name);
330
+ const text = readFileSync(f, 'utf8');
331
+ if (/from\s+['"]ably(\/[^'"]*)?['"]|require\(\s*['"]ably['"]\s*\)|ABLY_(API_)?KEY/.test(text)) hitsRt.push(f.startsWith(appDir) ? f.slice(appDir.length + 1) : f);
332
+ }
333
+ }
334
+ })(existsSync(join(appDir, 'src')) ? join(appDir, 'src') : appDir);
335
+ if (hitsRt.length) {
336
+ console.log(`${YELLOW}⚠${RESET} realtime — talks to the realtime provider directly in ${hitsRt.slice(0, 3).join(', ')}`);
337
+ warnings.push(`${hitsRt.join(', ')} use${hitsRt.length === 1 ? 's' : ''} the realtime provider (Ably) directly. Use SL.realtime instead — declare channels in the manifest (realtime.channels) and use realtime.channel() / onChange() (docs/realtime.md); never put a provider key in an app.`);
338
+ }
339
+ }
340
+
316
341
  // ---- package.json scripts point at files that exist ------------------------------------------
317
342
  // An upgrade that copies a script LINE but not the script FILE breaks every build at that step
318
343
  // (e.g. `postbuild: node scripts/smartlinks-deploy.mjs` with no scripts/smartlinks-deploy.mjs).