@ontemper/sdk 0.7.1-postgresql.6 → 0.8.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.
Files changed (77) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +8 -59
  3. package/dist/As2Resource.d.ts +76 -431
  4. package/dist/As2Resource.d.ts.map +1 -1
  5. package/dist/As2Resource.js +30 -31
  6. package/dist/As2Resource.js.map +1 -1
  7. package/dist/As2Transport.d.ts.map +1 -1
  8. package/dist/As2Transport.js +1 -3
  9. package/dist/As2Transport.js.map +1 -1
  10. package/dist/As2Wire.d.ts +0 -39
  11. package/dist/As2Wire.d.ts.map +1 -1
  12. package/dist/Contract/RuntimeApi.d.ts +0 -19
  13. package/dist/Contract/RuntimeApi.d.ts.map +1 -1
  14. package/dist/Contract/RuntimeApi.js +1 -1
  15. package/dist/Contract/RuntimeApi.js.map +1 -1
  16. package/dist/Edi.d.ts.map +1 -1
  17. package/dist/Edi.js +5 -6
  18. package/dist/Edi.js.map +1 -1
  19. package/dist/HttpApiResource.d.ts +160 -2899
  20. package/dist/HttpApiResource.d.ts.map +1 -1
  21. package/dist/HttpApiResource.js +60 -82
  22. package/dist/HttpApiResource.js.map +1 -1
  23. package/dist/Manifest.d.ts +1 -1
  24. package/dist/Manifest.d.ts.map +1 -1
  25. package/dist/Manifest.js +1 -1
  26. package/dist/Manifest.js.map +1 -1
  27. package/dist/Redaction.d.ts +1 -5
  28. package/dist/Redaction.d.ts.map +1 -1
  29. package/dist/Redaction.js +6 -28
  30. package/dist/Redaction.js.map +1 -1
  31. package/dist/ResourcesToken.d.ts +0 -2
  32. package/dist/ResourcesToken.d.ts.map +1 -1
  33. package/dist/ResourcesToken.js +1 -3
  34. package/dist/ResourcesToken.js.map +1 -1
  35. package/dist/RuntimeResources.d.ts +2 -16
  36. package/dist/RuntimeResources.d.ts.map +1 -1
  37. package/dist/RuntimeResources.js +14 -46
  38. package/dist/RuntimeResources.js.map +1 -1
  39. package/dist/TransportResource.d.ts +32 -1
  40. package/dist/TransportResource.d.ts.map +1 -1
  41. package/dist/TransportResource.js +19 -1
  42. package/dist/TransportResource.js.map +1 -1
  43. package/dist/Workflow.js +2 -2
  44. package/dist/Workflow.js.map +1 -1
  45. package/package.json +7 -39
  46. package/dist/DatabaseTunnelAuthorization.d.ts +0 -11
  47. package/dist/DatabaseTunnelAuthorization.d.ts.map +0 -1
  48. package/dist/DatabaseTunnelAuthorization.js +0 -35
  49. package/dist/DatabaseTunnelAuthorization.js.map +0 -1
  50. package/dist/Kafka.d.ts +0 -89
  51. package/dist/Kafka.d.ts.map +0 -1
  52. package/dist/Kafka.js +0 -297
  53. package/dist/Kafka.js.map +0 -1
  54. package/dist/PostgreSql.d.ts +0 -24
  55. package/dist/PostgreSql.d.ts.map +0 -1
  56. package/dist/PostgreSql.js +0 -55
  57. package/dist/PostgreSql.js.map +0 -1
  58. package/dist/PostgreSqlPool.d.ts +0 -32
  59. package/dist/PostgreSqlPool.d.ts.map +0 -1
  60. package/dist/PostgreSqlPool.js +0 -118
  61. package/dist/PostgreSqlPool.js.map +0 -1
  62. package/dist/PostgreSqlTimeouts.d.ts +0 -6
  63. package/dist/PostgreSqlTimeouts.d.ts.map +0 -1
  64. package/dist/PostgreSqlTimeouts.js +0 -17
  65. package/dist/PostgreSqlTimeouts.js.map +0 -1
  66. package/dist/PostgreSqlTunnel.d.ts +0 -25
  67. package/dist/PostgreSqlTunnel.d.ts.map +0 -1
  68. package/dist/PostgreSqlTunnel.js +0 -114
  69. package/dist/PostgreSqlTunnel.js.map +0 -1
  70. package/dist/ResourceRecords.d.ts +0 -1086
  71. package/dist/ResourceRecords.d.ts.map +0 -1
  72. package/dist/ResourceRecords.js +0 -303
  73. package/dist/ResourceRecords.js.map +0 -1
  74. package/dist/Resources.d.ts +0 -14
  75. package/dist/Resources.d.ts.map +0 -1
  76. package/dist/Resources.js +0 -14
  77. package/dist/Resources.js.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ Temper SDK License
2
+
3
+ Copyright (c) 2026 Temper. All rights reserved.
4
+
5
+ Temper grants you a limited, non-exclusive, non-transferable, revocable license to
6
+ install and use this package only to build, test, and run workflows on the Temper
7
+ platform under your agreement with Temper. Temper grants no other rights.
8
+
9
+ You may not:
10
+
11
+ 1. use this package, or any part of it, with a service other than the Temper
12
+ platform;
13
+ 2. copy, modify, distribute, sublicense, or publish this package, except as part
14
+ of a workflow that runs on the Temper platform;
15
+ 3. extract EDI standards content that this package contains or receives, such as
16
+ ASC X12 segment, element, and code definitions, or use that content outside
17
+ the Temper platform, including with any artificial intelligence system; or
18
+ 4. license this package, or software that contains it, under an open-source
19
+ license.
20
+
21
+ EDI standards content belongs to its owners. You receive it only inside the
22
+ Temper platform.
23
+
24
+ This license ends when your agreement with Temper ends. You must then stop using
25
+ this package.
26
+
27
+ THIS PACKAGE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. TO THE EXTENT THE
28
+ LAW ALLOWS, TEMPER IS NOT LIABLE FOR ANY DAMAGES THAT ARISE FROM ITS USE.
package/README.md CHANGED
@@ -295,7 +295,8 @@ service's `/edifact/*` routes. `toEdifact` serializes the interchange as given,
295
295
  first; no platform counter numbers EDIFACT yet. `acknowledgeEdifact` returns the CONTRL interchanges, or none; set a new UNB 0020 and UNH 0062 on each before
296
296
  `toEdifact`, because the service fills in the same reference every time.
297
297
 
298
- Provide `Edi.layer`. The service URL is `UNNBOUND_EDI_BASE_URL`; `UNNBOUND_EDI_API_KEY`, when set, replaces the
298
+ Provide `Edi.layer`. The service URL is `UNNBOUND_EDI_BASE_URL`, which Temper sets. The client has no default URL, so
299
+ without it every call fails with `reason: 'configuration'`. `UNNBOUND_EDI_API_KEY`, when set, replaces the
299
300
  Run token. The Run token goes only to `<UNNBOUND_API_URL>/api/edi-gateway`, and no EDI call follows a redirect. Lines such as `JSON to X12 completed.` carry the envelope (sender, receiver, counts), not the
300
301
  document. A failure is an `EdiError` whose `reason` is `validation`, `unauthorized`, `service`,
301
302
  `control_number`, or `configuration`, and whose `retryable` says whether the same call may succeed later.
@@ -324,59 +325,6 @@ approved; another runtime refuses a partner with TLS settings or a proxy. In tes
324
325
  `@temper/workflow/as2/testing` and pass its `fetch` to `testPlatform`; it keeps the platform ledger rules and runs
325
326
  no crypto.
326
327
 
327
- ## PostgreSQL
328
-
329
- `@temper/workflow/resources` opens a `pg.Pool` for a PostgreSQL Resource by key. A pool loads `pg`, and a builder's
330
- tunnel to a Temper-managed database loads `ws`, which the workflow installs; importing the entry point loads neither. TypeScript code also needs `@types/pg`.
331
-
332
- ```ts
333
- import { createPostgresqlPool, makePostgresqlPool } from '@temper/workflow/resources';
334
-
335
- // A script or a module-level pool; the caller ends it with `pool.end()`.
336
- const pool = await createPostgresqlPool('orders-db');
337
-
338
- // In an Effect service: the pool ends with the scope, and its password masks the workflow's log lines.
339
- const Ledger = Layer.effect(LedgerService, Effect.map(makePostgresqlPool('orders-db'), makeLedger));
340
- ```
341
-
342
- The pool resolves the Resource through the runtime API and opens no connection until the first query. It
343
- holds at most 5 connections, with a 10 s connect timeout, a 30 s idle timeout, and a 10 s statement timeout.
344
- A statement timeout logs `temper.database.query.timeout`, and an idle connection error logs
345
- `temper.database.connection.error`, without the query or the server text. `sslmode` maps to TLS as libpq does
346
- (`disable`, `require`, `verify-ca`, `verify-full`; default `verify-full`). A Resource without a password sends an
347
- empty one, never `PGPASSWORD` or `.pgpass`. A record with an SSH tunnel or RDS IAM authentication fails with
348
- `InvalidResourceError`.
349
-
350
- Deployed workflows and external databases connect over native TCP. In a builder sandbox
351
- (`TEMPER_DATABASE_TUNNEL=websocket`), a Temper-managed Resource connects through the Resources-authenticated
352
- WebSocket tunnel. Each physical connection reads the current runtime token, and a refused tunnel fails the
353
- connection without a TCP fallback. `createPostgresqlPool` registers the password in the process-wide secret
354
- registry; inside a workflow handler, prefer `makePostgresqlPool`, which registers it in the workflow's own.
355
-
356
- ## Resource records and Kafka
357
-
358
- `@temper/workflow/resources` gives Effect workflows the record schemas and Kafka options of `@ontemper/resources`:
359
- `KafkaResource`, `S3Resource`, `AzureBlobResource`, `SftpResource`, `PostgresqlResource`, and `kafkaConfig`. Declare the Resource with `Resource` from the root; its secrets arrive as
360
- `Redacted` values, and `kafkaConfig` unwraps them itself. It loads the optional peers `@aws-sdk/credential-providers` and
361
- `aws-msk-iam-sasl-signer-js` only for AWS MSK IAM.
362
-
363
- ```ts
364
- import { Resource } from '@temper/workflow';
365
- import { KafkaResource, kafkaConfig } from '@temper/workflow/resources';
366
- import { Kafka } from 'kafkajs';
367
-
368
- class Events extends Resource<Events>()('events', { type: 'kafka', schema: KafkaResource }) {}
369
-
370
- // In an Effect: const kafka = new Kafka(kafkaConfig(yield* Events));
371
- ```
372
-
373
- A record that a built-in schema rejects fails the read with the field name, never the value. An unknown closed
374
- value, such as a new `sslmode`, fails with `UnknownRecordValueError`.
375
-
376
- This release has no promise-style `env`: no `env.resources`, `env.variables`, `initialize`, or `reload`. Code that
377
- cannot run an Effect keeps `@ontemper/resources`; this entry does not modify that package. The legacy partners and
378
- connections APIs are excluded.
379
-
380
328
  ## Versions
381
329
 
382
330
  CI publishes every version to npm as `@ontemper/sdk`; nobody publishes by hand. Workflow code keeps
@@ -390,12 +338,9 @@ npm install --save-exact @temper/workflow@npm:@ontemper/sdk@<version>
390
338
  A published version never changes. The workflow template and the examples pin one exact
391
339
  version; `pnpm sdk:pin` moves them all together.
392
340
 
393
- The package has nine entry points: `@temper/workflow`, `@temper/workflow/testing`,
341
+ The package has eight entry points: `@temper/workflow`, `@temper/workflow/testing`,
394
342
  `@temper/workflow/contract`, `@temper/workflow/sftp`, `@temper/workflow/sftp/testing`,
395
- `@temper/workflow/edi`, `@temper/workflow/as2`, `@temper/workflow/as2/testing`, and `@temper/workflow/resources`.
396
- Only `/sftp` loads `ssh2`. In `/resources`, only a PostgreSQL pool loads `pg` and `ws`, and only AWS MSK IAM loads
397
- `@aws-sdk/credential-providers` and `aws-msk-iam-sasl-signer-js` (optional peer dependencies).
398
- `@temper/workflow/contract` holds the runtime Resources HttpApi and the
343
+ `@temper/workflow/edi`, `@temper/workflow/as2`, and `@temper/workflow/as2/testing`. Only `/sftp` loads `ssh2`. `@temper/workflow/contract` holds the runtime Resources HttpApi and the
399
344
  manifest, trigger, and invocation schemas that the platform imports. Workflow code rarely needs it.
400
345
 
401
346
  ## Develop and release
@@ -435,3 +380,7 @@ Raise `RUNTIME_API_VERSION` only when the SDK needs a changed platform runtime p
435
380
 
436
381
  Nothing more happens for prod. The template pin travels with the `stg` → `prod` release pull
437
382
  request, and customers get the version that the template pins on `prod`.
383
+
384
+ ## License
385
+
386
+ This package is licensed for use with the Temper platform only. It is not open source. See [LICENSE](LICENSE).