@postpeer/node 0.7.0 → 0.8.1
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/CHANGELOG.md +7 -128
- package/LICENSE +1 -1
- package/README.md +92 -314
- package/dist/index.cjs +1709 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3484 -0
- package/dist/index.d.ts +3484 -0
- package/dist/index.js +1690 -0
- package/dist/index.js.map +1 -0
- package/package.json +58 -131
- package/api-promise.d.mts +0 -3
- package/api-promise.d.mts.map +0 -1
- package/api-promise.d.ts +0 -3
- package/api-promise.d.ts.map +0 -1
- package/api-promise.js +0 -6
- package/api-promise.js.map +0 -1
- package/api-promise.mjs +0 -3
- package/api-promise.mjs.map +0 -1
- package/client.d.mts +0 -190
- package/client.d.mts.map +0 -1
- package/client.d.ts +0 -190
- package/client.d.ts.map +0 -1
- package/client.js +0 -485
- package/client.js.map +0 -1
- package/client.mjs +0 -481
- package/client.mjs.map +0 -1
- package/core/api-promise.d.mts +0 -46
- package/core/api-promise.d.mts.map +0 -1
- package/core/api-promise.d.ts +0 -46
- package/core/api-promise.d.ts.map +0 -1
- package/core/api-promise.js +0 -74
- package/core/api-promise.js.map +0 -1
- package/core/api-promise.mjs +0 -70
- package/core/api-promise.mjs.map +0 -1
- package/core/error.d.mts +0 -46
- package/core/error.d.mts.map +0 -1
- package/core/error.d.ts +0 -46
- package/core/error.d.ts.map +0 -1
- package/core/error.js +0 -113
- package/core/error.js.map +0 -1
- package/core/error.mjs +0 -97
- package/core/error.mjs.map +0 -1
- package/core/resource.d.mts +0 -6
- package/core/resource.d.mts.map +0 -1
- package/core/resource.d.ts +0 -6
- package/core/resource.d.ts.map +0 -1
- package/core/resource.js +0 -11
- package/core/resource.js.map +0 -1
- package/core/resource.mjs +0 -7
- package/core/resource.mjs.map +0 -1
- package/core/uploads.d.mts +0 -3
- package/core/uploads.d.mts.map +0 -1
- package/core/uploads.d.ts +0 -3
- package/core/uploads.d.ts.map +0 -1
- package/core/uploads.js +0 -6
- package/core/uploads.js.map +0 -1
- package/core/uploads.mjs +0 -2
- package/core/uploads.mjs.map +0 -1
- package/error.d.mts +0 -3
- package/error.d.mts.map +0 -1
- package/error.d.ts +0 -3
- package/error.d.ts.map +0 -1
- package/error.js +0 -6
- package/error.js.map +0 -1
- package/error.mjs +0 -3
- package/error.mjs.map +0 -1
- package/index.d.mts +0 -6
- package/index.d.mts.map +0 -1
- package/index.d.ts +0 -6
- package/index.d.ts.map +0 -1
- package/index.js +0 -30
- package/index.js.map +0 -1
- package/index.mjs +0 -7
- package/index.mjs.map +0 -1
- package/internal/builtin-types.d.mts +0 -73
- package/internal/builtin-types.d.mts.map +0 -1
- package/internal/builtin-types.d.ts +0 -73
- package/internal/builtin-types.d.ts.map +0 -1
- package/internal/builtin-types.js +0 -4
- package/internal/builtin-types.js.map +0 -1
- package/internal/builtin-types.mjs +0 -3
- package/internal/builtin-types.mjs.map +0 -1
- package/internal/detect-platform.d.mts +0 -15
- package/internal/detect-platform.d.mts.map +0 -1
- package/internal/detect-platform.d.ts +0 -15
- package/internal/detect-platform.d.ts.map +0 -1
- package/internal/detect-platform.js +0 -162
- package/internal/detect-platform.js.map +0 -1
- package/internal/detect-platform.mjs +0 -157
- package/internal/detect-platform.mjs.map +0 -1
- package/internal/errors.d.mts +0 -3
- package/internal/errors.d.mts.map +0 -1
- package/internal/errors.d.ts +0 -3
- package/internal/errors.d.ts.map +0 -1
- package/internal/errors.js +0 -41
- package/internal/errors.js.map +0 -1
- package/internal/errors.mjs +0 -36
- package/internal/errors.mjs.map +0 -1
- package/internal/headers.d.mts +0 -20
- package/internal/headers.d.mts.map +0 -1
- package/internal/headers.d.ts +0 -20
- package/internal/headers.d.ts.map +0 -1
- package/internal/headers.js +0 -79
- package/internal/headers.js.map +0 -1
- package/internal/headers.mjs +0 -74
- package/internal/headers.mjs.map +0 -1
- package/internal/parse.d.mts +0 -12
- package/internal/parse.d.mts.map +0 -1
- package/internal/parse.d.ts +0 -12
- package/internal/parse.d.ts.map +0 -1
- package/internal/parse.js +0 -40
- package/internal/parse.js.map +0 -1
- package/internal/parse.mjs +0 -37
- package/internal/parse.mjs.map +0 -1
- package/internal/qs/formats.d.mts +0 -7
- package/internal/qs/formats.d.mts.map +0 -1
- package/internal/qs/formats.d.ts +0 -7
- package/internal/qs/formats.d.ts.map +0 -1
- package/internal/qs/formats.js +0 -13
- package/internal/qs/formats.js.map +0 -1
- package/internal/qs/formats.mjs +0 -9
- package/internal/qs/formats.mjs.map +0 -1
- package/internal/qs/index.d.mts +0 -10
- package/internal/qs/index.d.mts.map +0 -1
- package/internal/qs/index.d.ts +0 -10
- package/internal/qs/index.d.ts.map +0 -1
- package/internal/qs/index.js +0 -14
- package/internal/qs/index.js.map +0 -1
- package/internal/qs/index.mjs +0 -10
- package/internal/qs/index.mjs.map +0 -1
- package/internal/qs/stringify.d.mts +0 -3
- package/internal/qs/stringify.d.mts.map +0 -1
- package/internal/qs/stringify.d.ts +0 -3
- package/internal/qs/stringify.d.ts.map +0 -1
- package/internal/qs/stringify.js +0 -277
- package/internal/qs/stringify.js.map +0 -1
- package/internal/qs/stringify.mjs +0 -274
- package/internal/qs/stringify.mjs.map +0 -1
- package/internal/qs/types.d.mts +0 -57
- package/internal/qs/types.d.mts.map +0 -1
- package/internal/qs/types.d.ts +0 -57
- package/internal/qs/types.d.ts.map +0 -1
- package/internal/qs/types.js +0 -3
- package/internal/qs/types.js.map +0 -1
- package/internal/qs/types.mjs +0 -2
- package/internal/qs/types.mjs.map +0 -1
- package/internal/qs/utils.d.mts +0 -15
- package/internal/qs/utils.d.mts.map +0 -1
- package/internal/qs/utils.d.ts +0 -15
- package/internal/qs/utils.d.ts.map +0 -1
- package/internal/qs/utils.js +0 -230
- package/internal/qs/utils.js.map +0 -1
- package/internal/qs/utils.mjs +0 -217
- package/internal/qs/utils.mjs.map +0 -1
- package/internal/request-options.d.mts +0 -75
- package/internal/request-options.d.mts.map +0 -1
- package/internal/request-options.d.ts +0 -75
- package/internal/request-options.d.ts.map +0 -1
- package/internal/request-options.js +0 -14
- package/internal/request-options.js.map +0 -1
- package/internal/request-options.mjs +0 -10
- package/internal/request-options.mjs.map +0 -1
- package/internal/shim-types.d.mts +0 -17
- package/internal/shim-types.d.mts.map +0 -1
- package/internal/shim-types.d.ts +0 -17
- package/internal/shim-types.d.ts.map +0 -1
- package/internal/shim-types.js +0 -4
- package/internal/shim-types.js.map +0 -1
- package/internal/shim-types.mjs +0 -3
- package/internal/shim-types.mjs.map +0 -1
- package/internal/shims.d.mts +0 -26
- package/internal/shims.d.mts.map +0 -1
- package/internal/shims.d.ts +0 -26
- package/internal/shims.d.ts.map +0 -1
- package/internal/shims.js +0 -92
- package/internal/shims.js.map +0 -1
- package/internal/shims.mjs +0 -85
- package/internal/shims.mjs.map +0 -1
- package/internal/to-file.d.mts +0 -45
- package/internal/to-file.d.mts.map +0 -1
- package/internal/to-file.d.ts +0 -45
- package/internal/to-file.d.ts.map +0 -1
- package/internal/to-file.js +0 -91
- package/internal/to-file.js.map +0 -1
- package/internal/to-file.mjs +0 -88
- package/internal/to-file.mjs.map +0 -1
- package/internal/tslib.js +0 -81
- package/internal/tslib.mjs +0 -17
- package/internal/types.d.mts +0 -69
- package/internal/types.d.mts.map +0 -1
- package/internal/types.d.ts +0 -69
- package/internal/types.d.ts.map +0 -1
- package/internal/types.js +0 -4
- package/internal/types.js.map +0 -1
- package/internal/types.mjs +0 -3
- package/internal/types.mjs.map +0 -1
- package/internal/uploads.d.mts +0 -42
- package/internal/uploads.d.mts.map +0 -1
- package/internal/uploads.d.ts +0 -42
- package/internal/uploads.d.ts.map +0 -1
- package/internal/uploads.js +0 -141
- package/internal/uploads.js.map +0 -1
- package/internal/uploads.mjs +0 -131
- package/internal/uploads.mjs.map +0 -1
- package/internal/utils/base64.d.mts +0 -3
- package/internal/utils/base64.d.mts.map +0 -1
- package/internal/utils/base64.d.ts +0 -3
- package/internal/utils/base64.d.ts.map +0 -1
- package/internal/utils/base64.js +0 -38
- package/internal/utils/base64.js.map +0 -1
- package/internal/utils/base64.mjs +0 -33
- package/internal/utils/base64.mjs.map +0 -1
- package/internal/utils/bytes.d.mts +0 -4
- package/internal/utils/bytes.d.mts.map +0 -1
- package/internal/utils/bytes.d.ts +0 -4
- package/internal/utils/bytes.d.ts.map +0 -1
- package/internal/utils/bytes.js +0 -31
- package/internal/utils/bytes.js.map +0 -1
- package/internal/utils/bytes.mjs +0 -26
- package/internal/utils/bytes.mjs.map +0 -1
- package/internal/utils/env.d.mts +0 -9
- package/internal/utils/env.d.mts.map +0 -1
- package/internal/utils/env.d.ts +0 -9
- package/internal/utils/env.d.ts.map +0 -1
- package/internal/utils/env.js +0 -22
- package/internal/utils/env.js.map +0 -1
- package/internal/utils/env.mjs +0 -18
- package/internal/utils/env.mjs.map +0 -1
- package/internal/utils/log.d.mts +0 -37
- package/internal/utils/log.d.mts.map +0 -1
- package/internal/utils/log.d.ts +0 -37
- package/internal/utils/log.d.ts.map +0 -1
- package/internal/utils/log.js +0 -88
- package/internal/utils/log.js.map +0 -1
- package/internal/utils/log.mjs +0 -82
- package/internal/utils/log.mjs.map +0 -1
- package/internal/utils/path.d.mts +0 -15
- package/internal/utils/path.d.mts.map +0 -1
- package/internal/utils/path.d.ts +0 -15
- package/internal/utils/path.d.ts.map +0 -1
- package/internal/utils/path.js +0 -79
- package/internal/utils/path.js.map +0 -1
- package/internal/utils/path.mjs +0 -74
- package/internal/utils/path.mjs.map +0 -1
- package/internal/utils/query.d.mts +0 -2
- package/internal/utils/query.d.mts.map +0 -1
- package/internal/utils/query.d.ts +0 -2
- package/internal/utils/query.d.ts.map +0 -1
- package/internal/utils/query.js +0 -10
- package/internal/utils/query.js.map +0 -1
- package/internal/utils/query.mjs +0 -6
- package/internal/utils/query.mjs.map +0 -1
- package/internal/utils/sleep.d.mts +0 -2
- package/internal/utils/sleep.d.mts.map +0 -1
- package/internal/utils/sleep.d.ts +0 -2
- package/internal/utils/sleep.d.ts.map +0 -1
- package/internal/utils/sleep.js +0 -7
- package/internal/utils/sleep.js.map +0 -1
- package/internal/utils/sleep.mjs +0 -3
- package/internal/utils/sleep.mjs.map +0 -1
- package/internal/utils/uuid.d.mts +0 -5
- package/internal/utils/uuid.d.mts.map +0 -1
- package/internal/utils/uuid.d.ts +0 -5
- package/internal/utils/uuid.d.ts.map +0 -1
- package/internal/utils/uuid.js +0 -19
- package/internal/utils/uuid.js.map +0 -1
- package/internal/utils/uuid.mjs +0 -15
- package/internal/utils/uuid.mjs.map +0 -1
- package/internal/utils/values.d.mts +0 -18
- package/internal/utils/values.d.mts.map +0 -1
- package/internal/utils/values.d.ts +0 -18
- package/internal/utils/values.d.ts.map +0 -1
- package/internal/utils/values.js +0 -112
- package/internal/utils/values.js.map +0 -1
- package/internal/utils/values.mjs +0 -94
- package/internal/utils/values.mjs.map +0 -1
- package/internal/utils.d.mts +0 -8
- package/internal/utils.d.mts.map +0 -1
- package/internal/utils.d.ts +0 -8
- package/internal/utils.d.ts.map +0 -1
- package/internal/utils.js +0 -12
- package/internal/utils.js.map +0 -1
- package/internal/utils.mjs +0 -9
- package/internal/utils.mjs.map +0 -1
- package/resource.d.mts +0 -3
- package/resource.d.mts.map +0 -1
- package/resource.d.ts +0 -3
- package/resource.d.ts.map +0 -1
- package/resource.js +0 -6
- package/resource.js.map +0 -1
- package/resource.mjs +0 -3
- package/resource.mjs.map +0 -1
- package/resources/connect/connect.d.mts +0 -31
- package/resources/connect/connect.d.mts.map +0 -1
- package/resources/connect/connect.d.ts +0 -31
- package/resources/connect/connect.d.ts.map +0 -1
- package/resources/connect/connect.js +0 -24
- package/resources/connect/connect.js.map +0 -1
- package/resources/connect/connect.mjs +0 -19
- package/resources/connect/connect.mjs.map +0 -1
- package/resources/connect/index.d.mts +0 -3
- package/resources/connect/index.d.mts.map +0 -1
- package/resources/connect/index.d.ts +0 -3
- package/resources/connect/index.d.ts.map +0 -1
- package/resources/connect/index.js +0 -9
- package/resources/connect/index.js.map +0 -1
- package/resources/connect/index.mjs +0 -4
- package/resources/connect/index.mjs.map +0 -1
- package/resources/connect/integrations.d.mts +0 -78
- package/resources/connect/integrations.d.mts.map +0 -1
- package/resources/connect/integrations.d.ts +0 -78
- package/resources/connect/integrations.d.ts.map +0 -1
- package/resources/connect/integrations.js +0 -22
- package/resources/connect/integrations.js.map +0 -1
- package/resources/connect/integrations.mjs +0 -18
- package/resources/connect/integrations.mjs.map +0 -1
- package/resources/connect.d.mts +0 -2
- package/resources/connect.d.mts.map +0 -1
- package/resources/connect.d.ts +0 -2
- package/resources/connect.d.ts.map +0 -1
- package/resources/connect.js +0 -6
- package/resources/connect.js.map +0 -1
- package/resources/connect.mjs +0 -3
- package/resources/connect.mjs.map +0 -1
- package/resources/health.d.mts +0 -23
- package/resources/health.d.mts.map +0 -1
- package/resources/health.d.ts +0 -23
- package/resources/health.d.ts.map +0 -1
- package/resources/health.js +0 -21
- package/resources/health.js.map +0 -1
- package/resources/health.mjs +0 -17
- package/resources/health.mjs.map +0 -1
- package/resources/index.d.mts +0 -6
- package/resources/index.d.mts.map +0 -1
- package/resources/index.d.ts +0 -6
- package/resources/index.d.ts.map +0 -1
- package/resources/index.js +0 -15
- package/resources/index.js.map +0 -1
- package/resources/index.mjs +0 -7
- package/resources/index.mjs.map +0 -1
- package/resources/media.d.mts +0 -27
- package/resources/media.d.mts.map +0 -1
- package/resources/media.d.ts +0 -27
- package/resources/media.d.ts.map +0 -1
- package/resources/media.js +0 -15
- package/resources/media.js.map +0 -1
- package/resources/media.mjs +0 -11
- package/resources/media.mjs.map +0 -1
- package/resources/platforms.d.mts +0 -22
- package/resources/platforms.d.mts.map +0 -1
- package/resources/platforms.d.ts +0 -22
- package/resources/platforms.d.ts.map +0 -1
- package/resources/platforms.js +0 -15
- package/resources/platforms.js.map +0 -1
- package/resources/platforms.mjs +0 -11
- package/resources/platforms.mjs.map +0 -1
- package/resources/posts/index.d.mts +0 -3
- package/resources/posts/index.d.mts.map +0 -1
- package/resources/posts/index.d.ts +0 -3
- package/resources/posts/index.d.ts.map +0 -1
- package/resources/posts/index.js +0 -9
- package/resources/posts/index.js.map +0 -1
- package/resources/posts/index.mjs +0 -4
- package/resources/posts/index.mjs.map +0 -1
- package/resources/posts/posts.d.mts +0 -300
- package/resources/posts/posts.d.mts.map +0 -1
- package/resources/posts/posts.d.ts +0 -300
- package/resources/posts/posts.d.ts.map +0 -1
- package/resources/posts/posts.js +0 -69
- package/resources/posts/posts.js.map +0 -1
- package/resources/posts/posts.mjs +0 -64
- package/resources/posts/posts.mjs.map +0 -1
- package/resources/posts/scheduled.d.mts +0 -121
- package/resources/posts/scheduled.d.mts.map +0 -1
- package/resources/posts/scheduled.d.ts +0 -121
- package/resources/posts/scheduled.d.ts.map +0 -1
- package/resources/posts/scheduled.js +0 -49
- package/resources/posts/scheduled.js.map +0 -1
- package/resources/posts/scheduled.mjs +0 -45
- package/resources/posts/scheduled.mjs.map +0 -1
- package/resources/posts.d.mts +0 -2
- package/resources/posts.d.mts.map +0 -1
- package/resources/posts.d.ts +0 -2
- package/resources/posts.d.ts.map +0 -1
- package/resources/posts.js +0 -6
- package/resources/posts.js.map +0 -1
- package/resources/posts.mjs +0 -3
- package/resources/posts.mjs.map +0 -1
- package/resources.d.mts +0 -2
- package/resources.d.mts.map +0 -1
- package/resources.d.ts +0 -2
- package/resources.d.ts.map +0 -1
- package/resources.js +0 -5
- package/resources.js.map +0 -1
- package/resources.mjs +0 -2
- package/resources.mjs.map +0 -1
- package/src/api-promise.ts +0 -2
- package/src/client.ts +0 -789
- package/src/core/README.md +0 -3
- package/src/core/api-promise.ts +0 -92
- package/src/core/error.ts +0 -130
- package/src/core/resource.ts +0 -11
- package/src/core/uploads.ts +0 -2
- package/src/error.ts +0 -2
- package/src/index.ts +0 -22
- package/src/internal/README.md +0 -3
- package/src/internal/builtin-types.ts +0 -93
- package/src/internal/detect-platform.ts +0 -196
- package/src/internal/errors.ts +0 -33
- package/src/internal/headers.ts +0 -97
- package/src/internal/parse.ts +0 -56
- package/src/internal/qs/LICENSE.md +0 -13
- package/src/internal/qs/README.md +0 -3
- package/src/internal/qs/formats.ts +0 -10
- package/src/internal/qs/index.ts +0 -13
- package/src/internal/qs/stringify.ts +0 -385
- package/src/internal/qs/types.ts +0 -71
- package/src/internal/qs/utils.ts +0 -265
- package/src/internal/request-options.ts +0 -91
- package/src/internal/shim-types.ts +0 -26
- package/src/internal/shims.ts +0 -107
- package/src/internal/to-file.ts +0 -154
- package/src/internal/types.ts +0 -93
- package/src/internal/uploads.ts +0 -187
- package/src/internal/utils/base64.ts +0 -40
- package/src/internal/utils/bytes.ts +0 -32
- package/src/internal/utils/env.ts +0 -18
- package/src/internal/utils/log.ts +0 -129
- package/src/internal/utils/path.ts +0 -88
- package/src/internal/utils/query.ts +0 -7
- package/src/internal/utils/sleep.ts +0 -3
- package/src/internal/utils/uuid.ts +0 -17
- package/src/internal/utils/values.ts +0 -105
- package/src/internal/utils.ts +0 -9
- package/src/lib/.keep +0 -4
- package/src/resource.ts +0 -2
- package/src/resources/connect/connect.ts +0 -70
- package/src/resources/connect/index.ts +0 -9
- package/src/resources/connect/integrations.ts +0 -130
- package/src/resources/connect.ts +0 -3
- package/src/resources/health.ts +0 -36
- package/src/resources/index.ts +0 -16
- package/src/resources/media.ts +0 -38
- package/src/resources/platforms.ts +0 -39
- package/src/resources/posts/index.ts +0 -20
- package/src/resources/posts/posts.ts +0 -472
- package/src/resources/posts/scheduled.ts +0 -180
- package/src/resources/posts.ts +0 -3
- package/src/resources.ts +0 -1
- package/src/tsconfig.json +0 -11
- package/src/uploads.ts +0 -2
- package/src/version.ts +0 -1
- package/uploads.d.mts +0 -3
- package/uploads.d.mts.map +0 -1
- package/uploads.d.ts +0 -3
- package/uploads.d.ts.map +0 -1
- package/uploads.js +0 -6
- package/uploads.js.map +0 -1
- package/uploads.mjs +0 -3
- package/uploads.mjs.map +0 -1
- package/version.d.mts +0 -2
- package/version.d.mts.map +0 -1
- package/version.d.ts +0 -2
- package/version.d.ts.map +0 -1
- package/version.js +0 -5
- package/version.js.map +0 -1
- package/version.mjs +0 -2
- package/version.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,134 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## 0.
|
|
3
|
+
## 0.8.1
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
- Standardized the public SDK class name as `PostPeer` throughout generated code and documentation.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## 0.8.0
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* **api:** api update ([ba583d0](https://github.com/PostPeer-API/postpeer-node/commit/ba583d0b9bfea6ea5657f8d73e832b3d5ab0a056))
|
|
13
|
-
* **api:** api update ([01f1907](https://github.com/PostPeer-API/postpeer-node/commit/01f1907a729f7e0fdbf1aa7b133553d4397417c1))
|
|
14
|
-
* **api:** api update ([7395420](https://github.com/PostPeer-API/postpeer-node/commit/7395420c425cb7d6efe09f53b5a45f0a9450c5cf))
|
|
9
|
+
- Rebuilt the SDK with Hey API from the PostPeer OpenAPI specification.
|
|
10
|
+
- Added the `PostPeer` client with retries, timeouts, and typed errors.
|
|
11
|
+
- Simplified generation, testing, packaging, and releases.
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
### Bug Fixes
|
|
18
|
-
|
|
19
|
-
* **typescript:** upgrade tsc-multi so that it works with Node 26 ([790d61c](https://github.com/PostPeer-API/postpeer-node/commit/790d61cba30fb1f83076f686ccfa2e586e958c5e))
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
### Chores
|
|
23
|
-
|
|
24
|
-
* redact api-key headers in debug logs ([9f4b4c0](https://github.com/PostPeer-API/postpeer-node/commit/9f4b4c000fb771ea8d1e510043537e1cbfb438e4))
|
|
25
|
-
* **tests:** remove redundant File import ([6f6647f](https://github.com/PostPeer-API/postpeer-node/commit/6f6647fdb4e21d9576a3898d724aefbaeecd1af9))
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
### Documentation
|
|
29
|
-
|
|
30
|
-
* update http mcp docs ([a7586bf](https://github.com/PostPeer-API/postpeer-node/commit/a7586bfc91be444612dc4137409c97fe89cc1617))
|
|
31
|
-
|
|
32
|
-
## 0.6.0 (2026-04-30)
|
|
33
|
-
|
|
34
|
-
Full Changelog: [v0.5.0...v0.6.0](https://github.com/PostPeer-API/postpeer-node/compare/v0.5.0...v0.6.0)
|
|
35
|
-
|
|
36
|
-
### Features
|
|
37
|
-
|
|
38
|
-
* **api:** api update ([d2e32a9](https://github.com/PostPeer-API/postpeer-node/commit/d2e32a9b1ed5f1ba0fffc0937262f97945840299))
|
|
39
|
-
* **api:** api update ([7fe25ac](https://github.com/PostPeer-API/postpeer-node/commit/7fe25ac62bd8fff2b4a8595bdf2354247125bee8))
|
|
40
|
-
* **api:** api update ([0f4244a](https://github.com/PostPeer-API/postpeer-node/commit/0f4244a93883c46284d9a3aae68fed3ee3dd470a))
|
|
41
|
-
* **api:** manual updates ([1a587f1](https://github.com/PostPeer-API/postpeer-node/commit/1a587f1d8d28cc22aa7a60065238bf27739a90b2))
|
|
42
|
-
* support setting headers via env ([da2c3df](https://github.com/PostPeer-API/postpeer-node/commit/da2c3df88282d1a007a836853a407271db3fcb43))
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
### Chores
|
|
46
|
-
|
|
47
|
-
* avoid formatting file that gets changed during releases ([bbec615](https://github.com/PostPeer-API/postpeer-node/commit/bbec6155e6d2255bd46e504ddaf932f84f829763))
|
|
48
|
-
* **format:** run eslint and prettier separately ([6da828b](https://github.com/PostPeer-API/postpeer-node/commit/6da828bb9a28fb72bb3b73e7c582d98369b6b320))
|
|
49
|
-
* **internal:** codegen related update ([a02ee4a](https://github.com/PostPeer-API/postpeer-node/commit/a02ee4a29b99d489770e63d73bf784d1b92e2eb3))
|
|
50
|
-
|
|
51
|
-
## 0.5.0 (2026-04-27)
|
|
52
|
-
|
|
53
|
-
Full Changelog: [v0.4.0...v0.5.0](https://github.com/PostPeer-API/postpeer-node/compare/v0.4.0...v0.5.0)
|
|
54
|
-
|
|
55
|
-
### Features
|
|
56
|
-
|
|
57
|
-
* **api:** api update ([4d62307](https://github.com/PostPeer-API/postpeer-node/commit/4d6230790ddd0f60eb57b8f98b0361cbf16f4904))
|
|
58
|
-
* **api:** api update ([9411834](https://github.com/PostPeer-API/postpeer-node/commit/9411834d9792457de0fc2904e31a8128c21f2c5d))
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
### Chores
|
|
62
|
-
|
|
63
|
-
* **formatter:** run prettier and eslint separately ([80fe4b5](https://github.com/PostPeer-API/postpeer-node/commit/80fe4b51aabe1b22f5275c2f1c09c360f994f75c))
|
|
64
|
-
* **internal:** more robust bootstrap script ([b581aeb](https://github.com/PostPeer-API/postpeer-node/commit/b581aeb94a851b78096edeee23bea88f491a5f9a))
|
|
65
|
-
* restructure docs search code ([162a5ca](https://github.com/PostPeer-API/postpeer-node/commit/162a5ca3ff9decf80a52a5e8849ab1bd32e84d17))
|
|
66
|
-
|
|
67
|
-
## 0.4.0 (2026-04-16)
|
|
68
|
-
|
|
69
|
-
Full Changelog: [v0.3.1...v0.4.0](https://github.com/PostPeer-API/postpeer-node/compare/v0.3.1...v0.4.0)
|
|
70
|
-
|
|
71
|
-
### Features
|
|
72
|
-
|
|
73
|
-
* **api:** manual updates ([f6c645f](https://github.com/PostPeer-API/postpeer-node/commit/f6c645f270e89f136b31e6eb77deee347721cc3c))
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
### Chores
|
|
77
|
-
|
|
78
|
-
* sync repo ([64cc226](https://github.com/PostPeer-API/postpeer-node/commit/64cc226bdaec83152c6fe31c843a952a50ea1b52))
|
|
79
|
-
* update SDK settings ([726ba8c](https://github.com/PostPeer-API/postpeer-node/commit/726ba8cc5e14a8fec6eee1f2c8062254ad7ab49d))
|
|
80
|
-
|
|
81
|
-
## 0.3.1 (2026-04-16)
|
|
82
|
-
|
|
83
|
-
Full Changelog: [v0.3.0...v0.3.1](https://github.com/PostPeer-API/postpeer-typescript/compare/v0.3.0...v0.3.1)
|
|
84
|
-
|
|
85
|
-
## 0.3.0 (2026-04-16)
|
|
86
|
-
|
|
87
|
-
Full Changelog: [v0.2.0...v0.3.0](https://github.com/PostPeer-API/postpeer-typescript/compare/v0.2.0...v0.3.0)
|
|
88
|
-
|
|
89
|
-
### Features
|
|
90
|
-
|
|
91
|
-
* **api:** manual updates ([0e51c04](https://github.com/PostPeer-API/postpeer-typescript/commit/0e51c04af30a1656bfd425e2f5efcac90c05f9f8))
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
### Chores
|
|
95
|
-
|
|
96
|
-
* remove custom code ([0f67ec6](https://github.com/PostPeer-API/postpeer-typescript/commit/0f67ec6be9415fc5fb2471c878f02007fe632a02))
|
|
97
|
-
* update SDK settings ([bda5df5](https://github.com/PostPeer-API/postpeer-typescript/commit/bda5df5817239e8cb162a3c1b69cc661fb6ac6f0))
|
|
98
|
-
|
|
99
|
-
## 0.2.0 (2026-04-16)
|
|
100
|
-
|
|
101
|
-
Full Changelog: [v0.1.2...v0.2.0](https://github.com/PostPeer-API/postpeer-typescript/compare/v0.1.2...v0.2.0)
|
|
102
|
-
|
|
103
|
-
### Features
|
|
104
|
-
|
|
105
|
-
* **api:** api update ([06b89da](https://github.com/PostPeer-API/postpeer-typescript/commit/06b89dad537b8cca199c69dcba8a5239012dc591))
|
|
106
|
-
|
|
107
|
-
## 0.1.2 (2026-04-15)
|
|
108
|
-
|
|
109
|
-
Full Changelog: [v0.1.1...v0.1.2](https://github.com/PostPeer-API/postpeer-typescript/compare/v0.1.1...v0.1.2)
|
|
110
|
-
|
|
111
|
-
## 0.1.1 (2026-04-15)
|
|
112
|
-
|
|
113
|
-
Full Changelog: [v0.1.0...v0.1.1](https://github.com/PostPeer-API/postpeer-typescript/compare/v0.1.0...v0.1.1)
|
|
114
|
-
|
|
115
|
-
### Chores
|
|
116
|
-
|
|
117
|
-
* configure new SDK language ([3ea01db](https://github.com/PostPeer-API/postpeer-typescript/commit/3ea01db9930bbcbcb20e3216db9d1e75f3ef21c9))
|
|
118
|
-
|
|
119
|
-
## 0.1.0 (2026-04-15)
|
|
120
|
-
|
|
121
|
-
Full Changelog: [v0.0.1...v0.1.0](https://github.com/PostPeer-API/postpeer-typescript/compare/v0.0.1...v0.1.0)
|
|
122
|
-
|
|
123
|
-
### Features
|
|
124
|
-
|
|
125
|
-
* **api:** manual updates ([77ced69](https://github.com/PostPeer-API/postpeer-typescript/commit/77ced69d5ab0d5840ad15b8bf0026620021b1b31))
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
### Chores
|
|
129
|
-
|
|
130
|
-
* configure new SDK language ([656bd65](https://github.com/PostPeer-API/postpeer-typescript/commit/656bd653dd11e873734b34cba9f8b117ba50ee59))
|
|
131
|
-
* update SDK settings ([9256963](https://github.com/PostPeer-API/postpeer-typescript/commit/9256963d1e1bfdfa976d477545618c64ed092360))
|
|
132
|
-
* update SDK settings ([24f8c7b](https://github.com/PostPeer-API/postpeer-typescript/commit/24f8c7b95dd8412634fb90832b64a2b0e1c48e02))
|
|
133
|
-
* update SDK settings ([f630304](https://github.com/PostPeer-API/postpeer-typescript/commit/f630304937e27a2bb454d7d9198011859d1f3e22))
|
|
134
|
-
* update SDK settings ([76cf155](https://github.com/PostPeer-API/postpeer-typescript/commit/76cf15568d0738279cc7e77eb03510dc2d5f8d9c))
|
|
13
|
+
Earlier release history remains available in Git tags.
|
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright 2026
|
|
189
|
+
Copyright 2026 PostPeer
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -1,364 +1,142 @@
|
|
|
1
|
-
# PostPeer
|
|
1
|
+
# PostPeer Node.js SDK
|
|
2
2
|
|
|
3
|
-
[
|
|
4
|
-
|
|
5
|
-
This library provides convenient access to the PostPeer REST API from server-side TypeScript or JavaScript.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
## MCP Server
|
|
9
|
-
|
|
10
|
-
Use the Postpeer MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.
|
|
11
|
-
|
|
12
|
-
[](https://cursor.com/en-US/install-mcp?name=postpeer-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsInBvc3RwZWVyLW1jcCJdLCJlbnYiOnsiUE9TVFBFRVJfQVBJX0tFWSI6Ik15IEFQSSBLZXkifX0)
|
|
13
|
-
[](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22postpeer-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22postpeer-mcp%22%5D%2C%22env%22%3A%7B%22POSTPEER_API_KEY%22%3A%22My%20API%20Key%22%7D%7D)
|
|
14
|
-
|
|
15
|
-
> Note: You may need to set environment variables in your MCP client.
|
|
3
|
+
The official TypeScript SDK for the [PostPeer API](https://postpeer.dev), generated from PostPeer's OpenAPI contract with [Hey API](https://heyapi.dev/).
|
|
16
4
|
|
|
17
5
|
## Installation
|
|
18
6
|
|
|
19
|
-
```
|
|
7
|
+
```bash
|
|
20
8
|
npm install @postpeer/node
|
|
21
9
|
```
|
|
22
10
|
|
|
23
|
-
|
|
11
|
+
Node.js 20 or newer is required.
|
|
24
12
|
|
|
25
|
-
|
|
13
|
+
## Quick start
|
|
26
14
|
|
|
27
|
-
<!-- prettier-ignore -->
|
|
28
|
-
```js
|
|
29
|
-
import Postpeer from '@postpeer/node';
|
|
30
|
-
|
|
31
|
-
const client = new Postpeer({
|
|
32
|
-
apiKey: process.env['POSTPEER_API_KEY'], // This is the default and can be omitted
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const response = await client.health.check();
|
|
36
|
-
|
|
37
|
-
console.log(response.ok);
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### Request & Response types
|
|
41
|
-
|
|
42
|
-
This library includes TypeScript definitions for all request params and response fields. You may import and use them like so:
|
|
43
|
-
|
|
44
|
-
<!-- prettier-ignore -->
|
|
45
15
|
```ts
|
|
46
|
-
import
|
|
47
|
-
|
|
48
|
-
const client = new Postpeer({
|
|
49
|
-
apiKey: process.env['POSTPEER_API_KEY'], // This is the default and can be omitted
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
const response: Postpeer.HealthCheckResponse = await client.health.check();
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors.
|
|
56
|
-
|
|
57
|
-
## Handling errors
|
|
58
|
-
|
|
59
|
-
When the library is unable to connect to the API,
|
|
60
|
-
or if the API returns a non-success status code (i.e., 4xx or 5xx response),
|
|
61
|
-
a subclass of `APIError` will be thrown:
|
|
62
|
-
|
|
63
|
-
<!-- prettier-ignore -->
|
|
64
|
-
```ts
|
|
65
|
-
const response = await client.health.check().catch(async (err) => {
|
|
66
|
-
if (err instanceof Postpeer.APIError) {
|
|
67
|
-
console.log(err.status); // 400
|
|
68
|
-
console.log(err.name); // BadRequestError
|
|
69
|
-
console.log(err.headers); // {server: 'nginx', ...}
|
|
70
|
-
} else {
|
|
71
|
-
throw err;
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
Error codes are as follows:
|
|
77
|
-
|
|
78
|
-
| Status Code | Error Type |
|
|
79
|
-
| ----------- | -------------------------- |
|
|
80
|
-
| 400 | `BadRequestError` |
|
|
81
|
-
| 401 | `AuthenticationError` |
|
|
82
|
-
| 403 | `PermissionDeniedError` |
|
|
83
|
-
| 404 | `NotFoundError` |
|
|
84
|
-
| 422 | `UnprocessableEntityError` |
|
|
85
|
-
| 429 | `RateLimitError` |
|
|
86
|
-
| >=500 | `InternalServerError` |
|
|
87
|
-
| N/A | `APIConnectionError` |
|
|
88
|
-
|
|
89
|
-
### Retries
|
|
16
|
+
import PostPeer from '@postpeer/node';
|
|
90
17
|
|
|
91
|
-
|
|
92
|
-
Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
|
|
93
|
-
429 Rate Limit, and >=500 Internal errors will all be retried by default.
|
|
18
|
+
const client = new PostPeer(); // Uses POSTPEER_API_KEY
|
|
94
19
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
maxRetries: 0, // default is 2
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
// Or, configure per-request:
|
|
105
|
-
await client.health.check({
|
|
106
|
-
maxRetries: 5,
|
|
107
|
-
});
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Timeouts
|
|
111
|
-
|
|
112
|
-
Requests time out after 1 minute by default. You can configure this with a `timeout` option:
|
|
113
|
-
|
|
114
|
-
<!-- prettier-ignore -->
|
|
115
|
-
```ts
|
|
116
|
-
// Configure the default for all requests:
|
|
117
|
-
const client = new Postpeer({
|
|
118
|
-
timeout: 20 * 1000, // 20 seconds (default is 1 minute)
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
// Override per-request:
|
|
122
|
-
await client.health.check({
|
|
123
|
-
timeout: 5 * 1000,
|
|
20
|
+
const { data: post } = await client.posts.create({
|
|
21
|
+
body: {
|
|
22
|
+
content: 'Hello from PostPeer!',
|
|
23
|
+
platforms: [{ platform: 'twitter', accountId: 'integration-id' }],
|
|
24
|
+
publishNow: true,
|
|
25
|
+
},
|
|
124
26
|
});
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
On timeout, an `APIConnectionTimeoutError` is thrown.
|
|
128
27
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
## Advanced Usage
|
|
132
|
-
|
|
133
|
-
### Accessing raw Response data (e.g., headers)
|
|
134
|
-
|
|
135
|
-
The "raw" `Response` returned by `fetch()` can be accessed through the `.asResponse()` method on the `APIPromise` type that all methods return.
|
|
136
|
-
This method returns as soon as the headers for a successful response are received and does not consume the response body, so you are free to write custom parsing or streaming logic.
|
|
137
|
-
|
|
138
|
-
You can also use the `.withResponse()` method to get the raw `Response` along with the parsed data.
|
|
139
|
-
Unlike `.asResponse()` this method consumes the body, returning once it is parsed.
|
|
140
|
-
|
|
141
|
-
<!-- prettier-ignore -->
|
|
142
|
-
```ts
|
|
143
|
-
const client = new Postpeer();
|
|
144
|
-
|
|
145
|
-
const response = await client.health.check().asResponse();
|
|
146
|
-
console.log(response.headers.get('X-My-Header'));
|
|
147
|
-
console.log(response.statusText); // access the underlying Response object
|
|
148
|
-
|
|
149
|
-
const { data: response, response: raw } = await client.health.check().withResponse();
|
|
150
|
-
console.log(raw.headers.get('X-My-Header'));
|
|
151
|
-
console.log(response.ok);
|
|
28
|
+
console.log(post);
|
|
152
29
|
```
|
|
153
30
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
> [!IMPORTANT]
|
|
157
|
-
> All log messages are intended for debugging only. The format and content of log messages
|
|
158
|
-
> may change between releases.
|
|
159
|
-
|
|
160
|
-
#### Log levels
|
|
161
|
-
|
|
162
|
-
The log level can be configured in two ways:
|
|
163
|
-
|
|
164
|
-
1. Via the `POSTPEER_LOG` environment variable
|
|
165
|
-
2. Using the `logLevel` client option (overrides the environment variable if set)
|
|
31
|
+
You can also pass the key directly:
|
|
166
32
|
|
|
167
33
|
```ts
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
const client = new Postpeer({
|
|
171
|
-
logLevel: 'debug', // Show all log messages
|
|
34
|
+
const client = new PostPeer({
|
|
35
|
+
apiKey: 'your-access-key',
|
|
172
36
|
});
|
|
173
37
|
```
|
|
174
38
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
- `'debug'` - Show debug messages, info, warnings, and errors
|
|
178
|
-
- `'info'` - Show info messages, warnings, and errors
|
|
179
|
-
- `'warn'` - Show warnings and errors (default)
|
|
180
|
-
- `'error'` - Show only errors
|
|
181
|
-
- `'off'` - Disable all logging
|
|
182
|
-
|
|
183
|
-
At the `'debug'` level, all HTTP requests and responses are logged, including headers and bodies.
|
|
184
|
-
Some authentication-related headers are redacted, but sensitive data in request and response bodies
|
|
185
|
-
may still be visible.
|
|
186
|
-
|
|
187
|
-
#### Custom logger
|
|
188
|
-
|
|
189
|
-
By default, this library logs to `globalThis.console`. You can also provide a custom logger.
|
|
190
|
-
Most logging libraries are supported, including [pino](https://www.npmjs.com/package/pino), [winston](https://www.npmjs.com/package/winston), [bunyan](https://www.npmjs.com/package/bunyan), [consola](https://www.npmjs.com/package/consola), [signale](https://www.npmjs.com/package/signale), and [@std/log](https://jsr.io/@std/log). If your logger doesn't work, please open an issue.
|
|
191
|
-
|
|
192
|
-
When providing a custom logger, the `logLevel` option still controls which messages are emitted, messages
|
|
193
|
-
below the configured level will not be sent to your logger.
|
|
39
|
+
## Configuration
|
|
194
40
|
|
|
195
41
|
```ts
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
logLevel: 'debug', // Send all messages to pino, allowing it to filter
|
|
42
|
+
const client = new PostPeer({
|
|
43
|
+
apiKey: 'your-access-key',
|
|
44
|
+
baseURL: 'https://api.postpeer.dev',
|
|
45
|
+
timeout: 60_000,
|
|
46
|
+
maxRetries: 2,
|
|
47
|
+
defaultHeaders: { 'X-Application': 'my-app' },
|
|
48
|
+
fetch: customFetch,
|
|
204
49
|
});
|
|
205
50
|
```
|
|
206
51
|
|
|
207
|
-
|
|
52
|
+
Every `PostPeer` instance owns an isolated HTTP client, so separate API keys and base URLs do not interfere with one another.
|
|
208
53
|
|
|
209
|
-
|
|
210
|
-
endpoints, params, or response properties, the library can still be used.
|
|
54
|
+
## Resources
|
|
211
55
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
To make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs.
|
|
215
|
-
Options on the client, such as retries, will be respected when making these requests.
|
|
56
|
+
The SDK follows the API's resource structure:
|
|
216
57
|
|
|
217
58
|
```ts
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
59
|
+
client.health.check();
|
|
60
|
+
client.health.verifyAccessKey();
|
|
61
|
+
|
|
62
|
+
client.posts.create({ body });
|
|
63
|
+
client.posts.list({ query });
|
|
64
|
+
client.posts.get({ path: { postId } });
|
|
65
|
+
client.posts.delete({ path: { postId } });
|
|
66
|
+
client.posts.scheduled.list();
|
|
67
|
+
client.posts.scheduled.cancel({ path: { postId } });
|
|
68
|
+
client.posts.scheduled.reschedule({ path: { postId }, body });
|
|
69
|
+
|
|
70
|
+
client.connect.getOAuthUrl({ path: { platform }, query });
|
|
71
|
+
client.connect.integrations.list();
|
|
72
|
+
client.connect.integrations.disconnect({ path: { id } });
|
|
73
|
+
|
|
74
|
+
client.profiles.list();
|
|
75
|
+
client.apps.list();
|
|
76
|
+
client.notifications.list();
|
|
77
|
+
client.platforms.list();
|
|
78
|
+
client.media.upload({ body });
|
|
79
|
+
client.analytics.get({ query });
|
|
80
|
+
client.usage.get();
|
|
81
|
+
client.pinterest.getBoards({ query });
|
|
82
|
+
client.tiktok.getCreatorInfo({ query });
|
|
83
|
+
client.ai.write({ body });
|
|
84
|
+
client.ai.generateImage({ body });
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Request parameters are grouped under `body`, `path`, `query`, and `headers`. Responses include `data`, `request`, and `response`, giving you access to the parsed result and the native Fetch objects.
|
|
88
|
+
|
|
89
|
+
## Error handling
|
|
229
90
|
|
|
230
91
|
```ts
|
|
231
|
-
|
|
232
|
-
// ...
|
|
233
|
-
// @ts-expect-error baz is not yet public
|
|
234
|
-
baz: 'undocumented option',
|
|
235
|
-
});
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
For requests with the `GET` verb, any extra params will be in the query, all other requests will send the
|
|
239
|
-
extra param in the body.
|
|
240
|
-
|
|
241
|
-
If you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request
|
|
242
|
-
options.
|
|
92
|
+
import PostPeer, { NotFoundError, RateLimitError } from '@postpeer/node';
|
|
243
93
|
|
|
244
|
-
|
|
94
|
+
const client = new PostPeer();
|
|
245
95
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
```ts
|
|
257
|
-
import fetch from 'my-fetch';
|
|
258
|
-
|
|
259
|
-
globalThis.fetch = fetch;
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
Or pass it to the client:
|
|
263
|
-
|
|
264
|
-
```ts
|
|
265
|
-
import Postpeer from '@postpeer/node';
|
|
266
|
-
import fetch from 'my-fetch';
|
|
267
|
-
|
|
268
|
-
const client = new Postpeer({ fetch });
|
|
96
|
+
try {
|
|
97
|
+
await client.posts.get({ path: { postId: 'missing' } });
|
|
98
|
+
} catch (error) {
|
|
99
|
+
if (error instanceof NotFoundError) {
|
|
100
|
+
console.error(error.status, error.requestId, error.message);
|
|
101
|
+
} else if (error instanceof RateLimitError) {
|
|
102
|
+
console.error('PostPeer rate limit reached');
|
|
103
|
+
}
|
|
104
|
+
}
|
|
269
105
|
```
|
|
270
106
|
|
|
271
|
-
|
|
107
|
+
The SDK exports typed API, connection, timeout, and user-abort errors.
|
|
272
108
|
|
|
273
|
-
|
|
109
|
+
## Updating the generated SDK
|
|
274
110
|
|
|
275
|
-
|
|
276
|
-
import Postpeer from '@postpeer/node';
|
|
111
|
+
The OpenAPI specification and npm releases are intentionally separate.
|
|
277
112
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
});
|
|
113
|
+
```bash
|
|
114
|
+
pnpm spec:fetch
|
|
115
|
+
pnpm generate
|
|
116
|
+
pnpm check
|
|
283
117
|
```
|
|
284
118
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
To modify proxy behavior, you can provide custom `fetchOptions` that add runtime-specific proxy
|
|
288
|
-
options to requests:
|
|
119
|
+
Commit `openapi.json` and `src/generated` together. This updates the code but does not publish a package.
|
|
289
120
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
```ts
|
|
293
|
-
import Postpeer from '@postpeer/node';
|
|
294
|
-
import * as undici from 'undici';
|
|
121
|
+
For a release, update `package.json`, `src/version.ts`, and `CHANGELOG.md`, run `pnpm check`, then publish with `npm publish --access public`.
|
|
295
122
|
|
|
296
|
-
|
|
297
|
-
const client = new Postpeer({
|
|
298
|
-
fetchOptions: {
|
|
299
|
-
dispatcher: proxyAgent,
|
|
300
|
-
},
|
|
301
|
-
});
|
|
302
|
-
```
|
|
123
|
+
Generated files under `src/generated` must not be edited by hand.
|
|
303
124
|
|
|
304
|
-
|
|
125
|
+
## Versioning
|
|
305
126
|
|
|
306
|
-
|
|
307
|
-
import Postpeer from '@postpeer/node';
|
|
127
|
+
PostPeer uses conservative pre-1.0 versioning:
|
|
308
128
|
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
});
|
|
314
|
-
```
|
|
129
|
+
- `0.8.0` is the first Hey API release.
|
|
130
|
+
- Compatible fixes and additions remain in `0.8.x`.
|
|
131
|
+
- A breaking SDK change moves to `0.9.0`.
|
|
132
|
+
- `1.0.0` will be published only when the SDK contract is considered mature.
|
|
315
133
|
|
|
316
|
-
|
|
134
|
+
OpenAPI changes may accumulate before a package release.
|
|
317
135
|
|
|
318
|
-
|
|
319
|
-
import Postpeer from 'npm:@postpeer/node';
|
|
136
|
+
## Development
|
|
320
137
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
},
|
|
326
|
-
});
|
|
138
|
+
```bash
|
|
139
|
+
pnpm install
|
|
140
|
+
pnpm generate
|
|
141
|
+
pnpm check
|
|
327
142
|
```
|
|
328
|
-
|
|
329
|
-
## Frequently Asked Questions
|
|
330
|
-
|
|
331
|
-
## Semantic versioning
|
|
332
|
-
|
|
333
|
-
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
|
|
334
|
-
|
|
335
|
-
1. Changes that only affect static types, without breaking runtime behavior.
|
|
336
|
-
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
|
|
337
|
-
3. Changes that we do not expect to impact the vast majority of users in practice.
|
|
338
|
-
|
|
339
|
-
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
|
|
340
|
-
|
|
341
|
-
We are keen for your feedback; please open an [issue](https://www.github.com/PostPeer-API/postpeer-node/issues) with questions, bugs, or suggestions.
|
|
342
|
-
|
|
343
|
-
## Requirements
|
|
344
|
-
|
|
345
|
-
TypeScript >= 4.9 is supported.
|
|
346
|
-
|
|
347
|
-
The following runtimes are supported:
|
|
348
|
-
|
|
349
|
-
- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more)
|
|
350
|
-
- Node.js 20 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions.
|
|
351
|
-
- Deno v1.28.0 or higher.
|
|
352
|
-
- Bun 1.0 or later.
|
|
353
|
-
- Cloudflare Workers.
|
|
354
|
-
- Vercel Edge Runtime.
|
|
355
|
-
- Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time).
|
|
356
|
-
- Nitro v2.6 or greater.
|
|
357
|
-
|
|
358
|
-
Note that React Native is not supported at this time.
|
|
359
|
-
|
|
360
|
-
If you are interested in other runtime environments, please open or upvote an issue on GitHub.
|
|
361
|
-
|
|
362
|
-
## Contributing
|
|
363
|
-
|
|
364
|
-
See [the contributing documentation](./CONTRIBUTING.md).
|