@distilled.cloud/axiom 0.30.2 → 1.0.0-rc.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/package.json +37 -43
- package/src/credentials.ts +27 -2
- package/src/edge-ingest.ts +6 -1
- package/src/edge-query.ts +6 -1
- package/src/errors.ts +7 -4
- package/src/index.ts +33 -11
- package/src/protocol.ts +111 -0
- package/src/retry.ts +3 -4
- package/src/services/edge_ingest.ts +124 -0
- package/src/services/edge_query.ts +197 -0
- package/src/services/index.ts +4 -0
- package/src/services/v2.ts +6647 -0
- package/src/traits.ts +42 -2
- package/README.md +0 -70
- package/lib/category.d.ts +0 -5
- package/lib/category.d.ts.map +0 -1
- package/lib/category.js +0 -5
- package/lib/category.js.map +0 -1
- package/lib/client.d.ts +0 -11
- package/lib/client.d.ts.map +0 -1
- package/lib/client.js +0 -108
- package/lib/client.js.map +0 -1
- package/lib/credentials.d.ts +0 -30
- package/lib/credentials.d.ts.map +0 -1
- package/lib/credentials.js +0 -43
- package/lib/credentials.js.map +0 -1
- package/lib/edge-ingest.d.ts +0 -2
- package/lib/edge-ingest.d.ts.map +0 -1
- package/lib/edge-ingest.js +0 -2
- package/lib/edge-ingest.js.map +0 -1
- package/lib/edge-query.d.ts +0 -2
- package/lib/edge-query.d.ts.map +0 -1
- package/lib/edge-query.js +0 -2
- package/lib/edge-query.js.map +0 -1
- package/lib/errors.d.ts +0 -31
- package/lib/errors.d.ts.map +0 -1
- package/lib/errors.js +0 -23
- package/lib/errors.js.map +0 -1
- package/lib/index.d.ts +0 -22
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -22
- package/lib/index.js.map +0 -1
- package/lib/operations/index.d.ts +0 -2
- package/lib/operations/index.d.ts.map +0 -1
- package/lib/operations/index.js +0 -2
- package/lib/operations/index.js.map +0 -1
- package/lib/operations/v1-edge-ingest/index.d.ts +0 -2
- package/lib/operations/v1-edge-ingest/index.d.ts.map +0 -1
- package/lib/operations/v1-edge-ingest/index.js +0 -2
- package/lib/operations/v1-edge-ingest/index.js.map +0 -1
- package/lib/operations/v1-edge-ingest/ingestToDataset.d.ts +0 -31
- package/lib/operations/v1-edge-ingest/ingestToDataset.d.ts.map +0 -1
- package/lib/operations/v1-edge-ingest/ingestToDataset.js +0 -36
- package/lib/operations/v1-edge-ingest/ingestToDataset.js.map +0 -1
- package/lib/operations/v1-edge-query/index.d.ts +0 -2
- package/lib/operations/v1-edge-query/index.d.ts.map +0 -1
- package/lib/operations/v1-edge-query/index.js +0 -2
- package/lib/operations/v1-edge-query/index.js.map +0 -1
- package/lib/operations/v1-edge-query/queryApl.d.ts +0 -66
- package/lib/operations/v1-edge-query/queryApl.d.ts.map +0 -1
- package/lib/operations/v1-edge-query/queryApl.js +0 -71
- package/lib/operations/v1-edge-query/queryApl.js.map +0 -1
- package/lib/operations/v2/createAPIToken.d.ts +0 -84
- package/lib/operations/v2/createAPIToken.d.ts.map +0 -1
- package/lib/operations/v2/createAPIToken.js +0 -89
- package/lib/operations/v2/createAPIToken.js.map +0 -1
- package/lib/operations/v2/createAnnotation.d.ts +0 -28
- package/lib/operations/v2/createAnnotation.d.ts.map +0 -1
- package/lib/operations/v2/createAnnotation.js +0 -33
- package/lib/operations/v2/createAnnotation.js.map +0 -1
- package/lib/operations/v2/createDashboard.d.ts +0 -332
- package/lib/operations/v2/createDashboard.d.ts.map +0 -1
- package/lib/operations/v2/createDashboard.js +0 -113
- package/lib/operations/v2/createDashboard.js.map +0 -1
- package/lib/operations/v2/createDataset.d.ts +0 -36
- package/lib/operations/v2/createDataset.d.ts.map +0 -1
- package/lib/operations/v2/createDataset.js +0 -51
- package/lib/operations/v2/createDataset.js.map +0 -1
- package/lib/operations/v2/createGroup.d.ts +0 -26
- package/lib/operations/v2/createGroup.d.ts.map +0 -1
- package/lib/operations/v2/createGroup.js +0 -31
- package/lib/operations/v2/createGroup.js.map +0 -1
- package/lib/operations/v2/createMapField.d.ts +0 -13
- package/lib/operations/v2/createMapField.d.ts.map +0 -1
- package/lib/operations/v2/createMapField.js +0 -18
- package/lib/operations/v2/createMapField.js.map +0 -1
- package/lib/operations/v2/createMonitor.d.ts +0 -66
- package/lib/operations/v2/createMonitor.d.ts.map +0 -1
- package/lib/operations/v2/createMonitor.js +0 -83
- package/lib/operations/v2/createMonitor.js.map +0 -1
- package/lib/operations/v2/createNotifier.d.ts +0 -95
- package/lib/operations/v2/createNotifier.d.ts.map +0 -1
- package/lib/operations/v2/createNotifier.js +0 -101
- package/lib/operations/v2/createNotifier.js.map +0 -1
- package/lib/operations/v2/createOrg.d.ts +0 -50
- package/lib/operations/v2/createOrg.d.ts.map +0 -1
- package/lib/operations/v2/createOrg.js +0 -70
- package/lib/operations/v2/createOrg.js.map +0 -1
- package/lib/operations/v2/createRole.d.ts +0 -84
- package/lib/operations/v2/createRole.d.ts.map +0 -1
- package/lib/operations/v2/createRole.js +0 -89
- package/lib/operations/v2/createRole.js.map +0 -1
- package/lib/operations/v2/createStarred.d.ts +0 -85
- package/lib/operations/v2/createStarred.d.ts.map +0 -1
- package/lib/operations/v2/createStarred.js +0 -100
- package/lib/operations/v2/createStarred.js.map +0 -1
- package/lib/operations/v2/createUser.d.ts +0 -23
- package/lib/operations/v2/createUser.d.ts.map +0 -1
- package/lib/operations/v2/createUser.js +0 -28
- package/lib/operations/v2/createUser.js.map +0 -1
- package/lib/operations/v2/createView.d.ts +0 -22
- package/lib/operations/v2/createView.d.ts.map +0 -1
- package/lib/operations/v2/createView.js +0 -27
- package/lib/operations/v2/createView.js.map +0 -1
- package/lib/operations/v2/createVirtualField.d.ts +0 -23
- package/lib/operations/v2/createVirtualField.d.ts.map +0 -1
- package/lib/operations/v2/createVirtualField.js +0 -30
- package/lib/operations/v2/createVirtualField.js.map +0 -1
- package/lib/operations/v2/deleteAPIToken.d.ts +0 -13
- package/lib/operations/v2/deleteAPIToken.d.ts.map +0 -1
- package/lib/operations/v2/deleteAPIToken.js +0 -19
- package/lib/operations/v2/deleteAPIToken.js.map +0 -1
- package/lib/operations/v2/deleteAnnotation.d.ts +0 -15
- package/lib/operations/v2/deleteAnnotation.d.ts.map +0 -1
- package/lib/operations/v2/deleteAnnotation.js +0 -21
- package/lib/operations/v2/deleteAnnotation.js.map +0 -1
- package/lib/operations/v2/deleteDashboard.d.ts +0 -15
- package/lib/operations/v2/deleteDashboard.d.ts.map +0 -1
- package/lib/operations/v2/deleteDashboard.js +0 -21
- package/lib/operations/v2/deleteDashboard.js.map +0 -1
- package/lib/operations/v2/deleteDataset.d.ts +0 -13
- package/lib/operations/v2/deleteDataset.d.ts.map +0 -1
- package/lib/operations/v2/deleteDataset.js +0 -19
- package/lib/operations/v2/deleteDataset.js.map +0 -1
- package/lib/operations/v2/deleteGroup.d.ts +0 -17
- package/lib/operations/v2/deleteGroup.d.ts.map +0 -1
- package/lib/operations/v2/deleteGroup.js +0 -23
- package/lib/operations/v2/deleteGroup.js.map +0 -1
- package/lib/operations/v2/deleteMapField.d.ts +0 -11
- package/lib/operations/v2/deleteMapField.d.ts.map +0 -1
- package/lib/operations/v2/deleteMapField.js +0 -20
- package/lib/operations/v2/deleteMapField.js.map +0 -1
- package/lib/operations/v2/deleteMonitor.d.ts +0 -13
- package/lib/operations/v2/deleteMonitor.d.ts.map +0 -1
- package/lib/operations/v2/deleteMonitor.js +0 -19
- package/lib/operations/v2/deleteMonitor.js.map +0 -1
- package/lib/operations/v2/deleteNotifier.d.ts +0 -13
- package/lib/operations/v2/deleteNotifier.d.ts.map +0 -1
- package/lib/operations/v2/deleteNotifier.js +0 -19
- package/lib/operations/v2/deleteNotifier.js.map +0 -1
- package/lib/operations/v2/deleteRole.d.ts +0 -17
- package/lib/operations/v2/deleteRole.d.ts.map +0 -1
- package/lib/operations/v2/deleteRole.js +0 -23
- package/lib/operations/v2/deleteRole.js.map +0 -1
- package/lib/operations/v2/deleteStarred.d.ts +0 -10
- package/lib/operations/v2/deleteStarred.d.ts.map +0 -1
- package/lib/operations/v2/deleteStarred.js +0 -16
- package/lib/operations/v2/deleteStarred.js.map +0 -1
- package/lib/operations/v2/deleteView.d.ts +0 -10
- package/lib/operations/v2/deleteView.d.ts.map +0 -1
- package/lib/operations/v2/deleteView.js +0 -16
- package/lib/operations/v2/deleteView.js.map +0 -1
- package/lib/operations/v2/deleteVirtualField.d.ts +0 -10
- package/lib/operations/v2/deleteVirtualField.d.ts.map +0 -1
- package/lib/operations/v2/deleteVirtualField.js +0 -17
- package/lib/operations/v2/deleteVirtualField.js.map +0 -1
- package/lib/operations/v2/getAPIToken.d.ts +0 -50
- package/lib/operations/v2/getAPIToken.d.ts.map +0 -1
- package/lib/operations/v2/getAPIToken.js +0 -55
- package/lib/operations/v2/getAPIToken.js.map +0 -1
- package/lib/operations/v2/getAPITokens.d.ts +0 -48
- package/lib/operations/v2/getAPITokens.d.ts.map +0 -1
- package/lib/operations/v2/getAPITokens.js +0 -51
- package/lib/operations/v2/getAPITokens.js.map +0 -1
- package/lib/operations/v2/getAnnotation.d.ts +0 -24
- package/lib/operations/v2/getAnnotation.d.ts.map +0 -1
- package/lib/operations/v2/getAnnotation.js +0 -29
- package/lib/operations/v2/getAnnotation.js.map +0 -1
- package/lib/operations/v2/getAnnotations.d.ts +0 -27
- package/lib/operations/v2/getAnnotations.d.ts.map +0 -1
- package/lib/operations/v2/getAnnotations.js +0 -31
- package/lib/operations/v2/getAnnotations.js.map +0 -1
- package/lib/operations/v2/getCurrentUser.d.ts +0 -19
- package/lib/operations/v2/getCurrentUser.d.ts.map +0 -1
- package/lib/operations/v2/getCurrentUser.js +0 -22
- package/lib/operations/v2/getCurrentUser.js.map +0 -1
- package/lib/operations/v2/getDashboard.d.ts +0 -174
- package/lib/operations/v2/getDashboard.d.ts.map +0 -1
- package/lib/operations/v2/getDashboard.js +0 -67
- package/lib/operations/v2/getDashboard.js.map +0 -1
- package/lib/operations/v2/getDataset.d.ts +0 -28
- package/lib/operations/v2/getDataset.d.ts.map +0 -1
- package/lib/operations/v2/getDataset.js +0 -38
- package/lib/operations/v2/getDataset.js.map +0 -1
- package/lib/operations/v2/getDatasets.d.ts +0 -27
- package/lib/operations/v2/getDatasets.d.ts.map +0 -1
- package/lib/operations/v2/getDatasets.js +0 -36
- package/lib/operations/v2/getDatasets.js.map +0 -1
- package/lib/operations/v2/getFieldForDataset.d.ts +0 -17
- package/lib/operations/v2/getFieldForDataset.d.ts.map +0 -1
- package/lib/operations/v2/getFieldForDataset.js +0 -27
- package/lib/operations/v2/getFieldForDataset.js.map +0 -1
- package/lib/operations/v2/getFieldsForDataset.d.ts +0 -16
- package/lib/operations/v2/getFieldsForDataset.d.ts.map +0 -1
- package/lib/operations/v2/getFieldsForDataset.js +0 -23
- package/lib/operations/v2/getFieldsForDataset.js.map +0 -1
- package/lib/operations/v2/getGroupById.d.ts +0 -24
- package/lib/operations/v2/getGroupById.d.ts.map +0 -1
- package/lib/operations/v2/getGroupById.js +0 -29
- package/lib/operations/v2/getGroupById.js.map +0 -1
- package/lib/operations/v2/getMapFields.d.ts +0 -10
- package/lib/operations/v2/getMapFields.d.ts.map +0 -1
- package/lib/operations/v2/getMapFields.js +0 -15
- package/lib/operations/v2/getMapFields.js.map +0 -1
- package/lib/operations/v2/getMonitor.d.ts +0 -43
- package/lib/operations/v2/getMonitor.d.ts.map +0 -1
- package/lib/operations/v2/getMonitor.js +0 -54
- package/lib/operations/v2/getMonitor.js.map +0 -1
- package/lib/operations/v2/getMonitorHistory.d.ts +0 -23
- package/lib/operations/v2/getMonitorHistory.d.ts.map +0 -1
- package/lib/operations/v2/getMonitorHistory.js +0 -28
- package/lib/operations/v2/getMonitorHistory.js.map +0 -1
- package/lib/operations/v2/getMonitors.d.ts +0 -39
- package/lib/operations/v2/getMonitors.d.ts.map +0 -1
- package/lib/operations/v2/getMonitors.js +0 -48
- package/lib/operations/v2/getMonitors.js.map +0 -1
- package/lib/operations/v2/getNotifier.d.ts +0 -58
- package/lib/operations/v2/getNotifier.d.ts.map +0 -1
- package/lib/operations/v2/getNotifier.js +0 -64
- package/lib/operations/v2/getNotifier.js.map +0 -1
- package/lib/operations/v2/getNotifiers.d.ts +0 -54
- package/lib/operations/v2/getNotifiers.d.ts.map +0 -1
- package/lib/operations/v2/getNotifiers.js +0 -58
- package/lib/operations/v2/getNotifiers.js.map +0 -1
- package/lib/operations/v2/getOrg.d.ts +0 -50
- package/lib/operations/v2/getOrg.d.ts.map +0 -1
- package/lib/operations/v2/getOrg.js +0 -71
- package/lib/operations/v2/getOrg.js.map +0 -1
- package/lib/operations/v2/getOrgs.d.ts +0 -48
- package/lib/operations/v2/getOrgs.d.ts.map +0 -1
- package/lib/operations/v2/getOrgs.js +0 -67
- package/lib/operations/v2/getOrgs.js.map +0 -1
- package/lib/operations/v2/getRoleById.d.ts +0 -53
- package/lib/operations/v2/getRoleById.d.ts.map +0 -1
- package/lib/operations/v2/getRoleById.js +0 -58
- package/lib/operations/v2/getRoleById.js.map +0 -1
- package/lib/operations/v2/getStarred.d.ts +0 -49
- package/lib/operations/v2/getStarred.d.ts.map +0 -1
- package/lib/operations/v2/getStarred.js +0 -59
- package/lib/operations/v2/getStarred.js.map +0 -1
- package/lib/operations/v2/getStarredQueries.d.ts +0 -59
- package/lib/operations/v2/getStarredQueries.d.ts.map +0 -1
- package/lib/operations/v2/getStarredQueries.js +0 -68
- package/lib/operations/v2/getStarredQueries.js.map +0 -1
- package/lib/operations/v2/getUser.d.ts +0 -21
- package/lib/operations/v2/getUser.d.ts.map +0 -1
- package/lib/operations/v2/getUser.js +0 -26
- package/lib/operations/v2/getUser.js.map +0 -1
- package/lib/operations/v2/getUsers.d.ts +0 -19
- package/lib/operations/v2/getUsers.d.ts.map +0 -1
- package/lib/operations/v2/getUsers.js +0 -22
- package/lib/operations/v2/getUsers.js.map +0 -1
- package/lib/operations/v2/getView.d.ts +0 -17
- package/lib/operations/v2/getView.d.ts.map +0 -1
- package/lib/operations/v2/getView.js +0 -22
- package/lib/operations/v2/getView.js.map +0 -1
- package/lib/operations/v2/getViews.d.ts +0 -15
- package/lib/operations/v2/getViews.d.ts.map +0 -1
- package/lib/operations/v2/getViews.js +0 -18
- package/lib/operations/v2/getViews.js.map +0 -1
- package/lib/operations/v2/getVirtualField.d.ts +0 -18
- package/lib/operations/v2/getVirtualField.d.ts.map +0 -1
- package/lib/operations/v2/getVirtualField.js +0 -23
- package/lib/operations/v2/getVirtualField.js.map +0 -1
- package/lib/operations/v2/getVirtualFields.d.ts +0 -17
- package/lib/operations/v2/getVirtualFields.d.ts.map +0 -1
- package/lib/operations/v2/getVirtualFields.js +0 -21
- package/lib/operations/v2/getVirtualFields.js.map +0 -1
- package/lib/operations/v2/index.d.ts +0 -78
- package/lib/operations/v2/index.d.ts.map +0 -1
- package/lib/operations/v2/index.js +0 -78
- package/lib/operations/v2/index.js.map +0 -1
- package/lib/operations/v2/listDashboards.d.ts +0 -174
- package/lib/operations/v2/listDashboards.d.ts.map +0 -1
- package/lib/operations/v2/listDashboards.js +0 -66
- package/lib/operations/v2/listDashboards.js.map +0 -1
- package/lib/operations/v2/listGroups.d.ts +0 -20
- package/lib/operations/v2/listGroups.d.ts.map +0 -1
- package/lib/operations/v2/listGroups.js +0 -23
- package/lib/operations/v2/listGroups.js.map +0 -1
- package/lib/operations/v2/listRoles.d.ts +0 -49
- package/lib/operations/v2/listRoles.d.ts.map +0 -1
- package/lib/operations/v2/listRoles.js +0 -52
- package/lib/operations/v2/listRoles.js.map +0 -1
- package/lib/operations/v2/patchDashboardChart.d.ts +0 -183
- package/lib/operations/v2/patchDashboardChart.d.ts.map +0 -1
- package/lib/operations/v2/patchDashboardChart.js +0 -81
- package/lib/operations/v2/patchDashboardChart.js.map +0 -1
- package/lib/operations/v2/regenerateAPIToken.d.ts +0 -89
- package/lib/operations/v2/regenerateAPIToken.d.ts.map +0 -1
- package/lib/operations/v2/regenerateAPIToken.js +0 -96
- package/lib/operations/v2/regenerateAPIToken.js.map +0 -1
- package/lib/operations/v2/removeUserFromOrg.d.ts +0 -13
- package/lib/operations/v2/removeUserFromOrg.d.ts.map +0 -1
- package/lib/operations/v2/removeUserFromOrg.js +0 -19
- package/lib/operations/v2/removeUserFromOrg.js.map +0 -1
- package/lib/operations/v2/trimDataset.d.ts +0 -16
- package/lib/operations/v2/trimDataset.d.ts.map +0 -1
- package/lib/operations/v2/trimDataset.js +0 -22
- package/lib/operations/v2/trimDataset.js.map +0 -1
- package/lib/operations/v2/updateAnnotation.d.ts +0 -31
- package/lib/operations/v2/updateAnnotation.d.ts.map +0 -1
- package/lib/operations/v2/updateAnnotation.js +0 -36
- package/lib/operations/v2/updateAnnotation.js.map +0 -1
- package/lib/operations/v2/updateCurrentUser.d.ts +0 -20
- package/lib/operations/v2/updateCurrentUser.d.ts.map +0 -1
- package/lib/operations/v2/updateCurrentUser.js +0 -25
- package/lib/operations/v2/updateCurrentUser.js.map +0 -1
- package/lib/operations/v2/updateDashboard.d.ts +0 -332
- package/lib/operations/v2/updateDashboard.d.ts.map +0 -1
- package/lib/operations/v2/updateDashboard.js +0 -113
- package/lib/operations/v2/updateDashboard.js.map +0 -1
- package/lib/operations/v2/updateDataset.d.ts +0 -31
- package/lib/operations/v2/updateDataset.d.ts.map +0 -1
- package/lib/operations/v2/updateDataset.js +0 -41
- package/lib/operations/v2/updateDataset.js.map +0 -1
- package/lib/operations/v2/updateFieldForDataset.d.ts +0 -22
- package/lib/operations/v2/updateFieldForDataset.d.ts.map +0 -1
- package/lib/operations/v2/updateFieldForDataset.js +0 -32
- package/lib/operations/v2/updateFieldForDataset.js.map +0 -1
- package/lib/operations/v2/updateGroup.d.ts +0 -29
- package/lib/operations/v2/updateGroup.d.ts.map +0 -1
- package/lib/operations/v2/updateGroup.js +0 -34
- package/lib/operations/v2/updateGroup.js.map +0 -1
- package/lib/operations/v2/updateMapFields.d.ts +0 -10
- package/lib/operations/v2/updateMapFields.d.ts.map +0 -1
- package/lib/operations/v2/updateMapFields.js +0 -15
- package/lib/operations/v2/updateMapFields.js.map +0 -1
- package/lib/operations/v2/updateMonitor.d.ts +0 -67
- package/lib/operations/v2/updateMonitor.d.ts.map +0 -1
- package/lib/operations/v2/updateMonitor.js +0 -84
- package/lib/operations/v2/updateMonitor.js.map +0 -1
- package/lib/operations/v2/updateNotifier.d.ts +0 -96
- package/lib/operations/v2/updateNotifier.d.ts.map +0 -1
- package/lib/operations/v2/updateNotifier.js +0 -102
- package/lib/operations/v2/updateNotifier.js.map +0 -1
- package/lib/operations/v2/updateOrg.d.ts +0 -51
- package/lib/operations/v2/updateOrg.d.ts.map +0 -1
- package/lib/operations/v2/updateOrg.js +0 -72
- package/lib/operations/v2/updateOrg.js.map +0 -1
- package/lib/operations/v2/updateRole.d.ts +0 -87
- package/lib/operations/v2/updateRole.d.ts.map +0 -1
- package/lib/operations/v2/updateRole.js +0 -92
- package/lib/operations/v2/updateRole.js.map +0 -1
- package/lib/operations/v2/updateStarred.d.ts +0 -86
- package/lib/operations/v2/updateStarred.d.ts.map +0 -1
- package/lib/operations/v2/updateStarred.js +0 -101
- package/lib/operations/v2/updateStarred.js.map +0 -1
- package/lib/operations/v2/updateUserRole.d.ts +0 -22
- package/lib/operations/v2/updateUserRole.d.ts.map +0 -1
- package/lib/operations/v2/updateUserRole.js +0 -27
- package/lib/operations/v2/updateUserRole.js.map +0 -1
- package/lib/operations/v2/updateView.d.ts +0 -23
- package/lib/operations/v2/updateView.d.ts.map +0 -1
- package/lib/operations/v2/updateView.js +0 -28
- package/lib/operations/v2/updateView.js.map +0 -1
- package/lib/operations/v2/updateVirtualField.d.ts +0 -24
- package/lib/operations/v2/updateVirtualField.d.ts.map +0 -1
- package/lib/operations/v2/updateVirtualField.js +0 -31
- package/lib/operations/v2/updateVirtualField.js.map +0 -1
- package/lib/operations/v2/vacuumDataset.d.ts +0 -9
- package/lib/operations/v2/vacuumDataset.d.ts.map +0 -1
- package/lib/operations/v2/vacuumDataset.js +0 -14
- package/lib/operations/v2/vacuumDataset.js.map +0 -1
- package/lib/retry.d.ts +0 -33
- package/lib/retry.d.ts.map +0 -1
- package/lib/retry.js +0 -33
- package/lib/retry.js.map +0 -1
- package/lib/sensitive.d.ts +0 -5
- package/lib/sensitive.d.ts.map +0 -1
- package/lib/sensitive.js +0 -5
- package/lib/sensitive.js.map +0 -1
- package/lib/traits.d.ts +0 -5
- package/lib/traits.d.ts.map +0 -1
- package/lib/traits.js +0 -5
- package/lib/traits.js.map +0 -1
- package/src/category.ts +0 -4
- package/src/client.ts +0 -122
- package/src/operations/index.ts +0 -1
- package/src/operations/v1-edge-ingest/index.ts +0 -1
- package/src/operations/v1-edge-ingest/ingestToDataset.ts +0 -60
- package/src/operations/v1-edge-query/index.ts +0 -1
- package/src/operations/v1-edge-query/queryApl.ts +0 -134
- package/src/operations/v2/createAPIToken.ts +0 -272
- package/src/operations/v2/createAnnotation.ts +0 -58
- package/src/operations/v2/createDashboard.ts +0 -472
- package/src/operations/v2/createDataset.ts +0 -92
- package/src/operations/v2/createGroup.ts +0 -52
- package/src/operations/v2/createMapField.ts +0 -31
- package/src/operations/v2/createMonitor.ts +0 -160
- package/src/operations/v2/createNotifier.ts +0 -194
- package/src/operations/v2/createOrg.ts +0 -135
- package/src/operations/v2/createRole.ts +0 -276
- package/src/operations/v2/createStarred.ts +0 -203
- package/src/operations/v2/createUser.ts +0 -47
- package/src/operations/v2/createView.ts +0 -49
- package/src/operations/v2/createVirtualField.ts +0 -53
- package/src/operations/v2/deleteAPIToken.ts +0 -29
- package/src/operations/v2/deleteAnnotation.ts +0 -31
- package/src/operations/v2/deleteDashboard.ts +0 -31
- package/src/operations/v2/deleteDataset.ts +0 -29
- package/src/operations/v2/deleteGroup.ts +0 -33
- package/src/operations/v2/deleteMapField.ts +0 -31
- package/src/operations/v2/deleteMonitor.ts +0 -29
- package/src/operations/v2/deleteNotifier.ts +0 -29
- package/src/operations/v2/deleteRole.ts +0 -33
- package/src/operations/v2/deleteStarred.ts +0 -26
- package/src/operations/v2/deleteView.ts +0 -26
- package/src/operations/v2/deleteVirtualField.ts +0 -27
- package/src/operations/v2/getAPIToken.ts +0 -150
- package/src/operations/v2/getAPITokens.ts +0 -148
- package/src/operations/v2/getAnnotation.ts +0 -48
- package/src/operations/v2/getAnnotations.ts +0 -54
- package/src/operations/v2/getCurrentUser.ts +0 -37
- package/src/operations/v2/getDashboard.ts +0 -252
- package/src/operations/v2/getDataset.ts +0 -67
- package/src/operations/v2/getDatasets.ts +0 -65
- package/src/operations/v2/getFieldForDataset.ts +0 -44
- package/src/operations/v2/getFieldsForDataset.ts +0 -41
- package/src/operations/v2/getGroupById.ts +0 -46
- package/src/operations/v2/getMapFields.ts +0 -27
- package/src/operations/v2/getMonitor.ts +0 -99
- package/src/operations/v2/getMonitorHistory.ts +0 -47
- package/src/operations/v2/getMonitors.ts +0 -93
- package/src/operations/v2/getNotifier.ts +0 -117
- package/src/operations/v2/getNotifiers.ts +0 -111
- package/src/operations/v2/getOrg.ts +0 -135
- package/src/operations/v2/getOrgs.ts +0 -131
- package/src/operations/v2/getRoleById.ts +0 -158
- package/src/operations/v2/getStarred.ts +0 -117
- package/src/operations/v2/getStarredQueries.ts +0 -134
- package/src/operations/v2/getUser.ts +0 -43
- package/src/operations/v2/getUsers.ts +0 -39
- package/src/operations/v2/getView.ts +0 -39
- package/src/operations/v2/getViews.ts +0 -35
- package/src/operations/v2/getVirtualField.ts +0 -41
- package/src/operations/v2/getVirtualFields.ts +0 -41
- package/src/operations/v2/index.ts +0 -77
- package/src/operations/v2/listDashboards.ts +0 -254
- package/src/operations/v2/listGroups.ts +0 -40
- package/src/operations/v2/listRoles.ts +0 -156
- package/src/operations/v2/patchDashboardChart.ts +0 -275
- package/src/operations/v2/regenerateAPIToken.ts +0 -320
- package/src/operations/v2/removeUserFromOrg.ts +0 -29
- package/src/operations/v2/trimDataset.ts +0 -33
- package/src/operations/v2/updateAnnotation.ts +0 -62
- package/src/operations/v2/updateCurrentUser.ts +0 -42
- package/src/operations/v2/updateDashboard.ts +0 -472
- package/src/operations/v2/updateDataset.ts +0 -73
- package/src/operations/v2/updateFieldForDataset.ts +0 -54
- package/src/operations/v2/updateGroup.ts +0 -56
- package/src/operations/v2/updateMapFields.ts +0 -27
- package/src/operations/v2/updateMonitor.ts +0 -162
- package/src/operations/v2/updateNotifier.ts +0 -196
- package/src/operations/v2/updateOrg.ts +0 -137
- package/src/operations/v2/updateRole.ts +0 -280
- package/src/operations/v2/updateStarred.ts +0 -205
- package/src/operations/v2/updateUserRole.ts +0 -45
- package/src/operations/v2/updateView.ts +0 -51
- package/src/operations/v2/updateVirtualField.ts +0 -55
- package/src/operations/v2/vacuumDataset.ts +0 -24
- package/src/sensitive.ts +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@distilled.cloud/axiom",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-rc.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/alchemy-run/distilled",
|
|
@@ -9,86 +9,80 @@
|
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
10
|
"type": "module",
|
|
11
11
|
"sideEffects": false,
|
|
12
|
-
"module": "src/index.ts",
|
|
13
12
|
"files": [
|
|
14
|
-
"lib",
|
|
15
13
|
"src"
|
|
16
14
|
],
|
|
17
15
|
"exports": {
|
|
18
16
|
".": {
|
|
19
17
|
"types": "./lib/index.d.ts",
|
|
20
18
|
"bun": "./src/index.ts",
|
|
19
|
+
"worker": "./src/index.ts",
|
|
21
20
|
"default": "./lib/index.js"
|
|
22
21
|
},
|
|
23
|
-
"./Category": {
|
|
24
|
-
"types": "./lib/category.d.ts",
|
|
25
|
-
"bun": "./src/category.ts",
|
|
26
|
-
"default": "./lib/category.js"
|
|
27
|
-
},
|
|
28
|
-
"./Client": {
|
|
29
|
-
"types": "./lib/client.d.ts",
|
|
30
|
-
"bun": "./src/client.ts",
|
|
31
|
-
"default": "./lib/client.js"
|
|
32
|
-
},
|
|
33
22
|
"./Credentials": {
|
|
34
23
|
"types": "./lib/credentials.d.ts",
|
|
35
24
|
"bun": "./src/credentials.ts",
|
|
25
|
+
"worker": "./src/credentials.ts",
|
|
36
26
|
"default": "./lib/credentials.js"
|
|
37
27
|
},
|
|
38
28
|
"./Errors": {
|
|
39
29
|
"types": "./lib/errors.d.ts",
|
|
40
30
|
"bun": "./src/errors.ts",
|
|
31
|
+
"worker": "./src/errors.ts",
|
|
41
32
|
"default": "./lib/errors.js"
|
|
42
33
|
},
|
|
34
|
+
"./Traits": {
|
|
35
|
+
"types": "./lib/traits.d.ts",
|
|
36
|
+
"bun": "./src/traits.ts",
|
|
37
|
+
"worker": "./src/traits.ts",
|
|
38
|
+
"default": "./lib/traits.js"
|
|
39
|
+
},
|
|
40
|
+
"./Protocol": {
|
|
41
|
+
"types": "./lib/protocol.d.ts",
|
|
42
|
+
"bun": "./src/protocol.ts",
|
|
43
|
+
"worker": "./src/protocol.ts",
|
|
44
|
+
"default": "./lib/protocol.js"
|
|
45
|
+
},
|
|
46
|
+
"./Retry": {
|
|
47
|
+
"types": "./lib/retry.d.ts",
|
|
48
|
+
"bun": "./src/retry.ts",
|
|
49
|
+
"worker": "./src/retry.ts",
|
|
50
|
+
"default": "./lib/retry.js"
|
|
51
|
+
},
|
|
43
52
|
"./edge-ingest": {
|
|
44
53
|
"types": "./lib/edge-ingest.d.ts",
|
|
45
54
|
"bun": "./src/edge-ingest.ts",
|
|
55
|
+
"worker": "./src/edge-ingest.ts",
|
|
46
56
|
"default": "./lib/edge-ingest.js"
|
|
47
57
|
},
|
|
48
58
|
"./edge-query": {
|
|
49
59
|
"types": "./lib/edge-query.d.ts",
|
|
50
60
|
"bun": "./src/edge-query.ts",
|
|
61
|
+
"worker": "./src/edge-query.ts",
|
|
51
62
|
"default": "./lib/edge-query.js"
|
|
52
63
|
},
|
|
53
|
-
"
|
|
54
|
-
"types": "./lib/
|
|
55
|
-
"bun": "./src/
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
"./Sensitive": {
|
|
59
|
-
"types": "./lib/sensitive.d.ts",
|
|
60
|
-
"bun": "./src/sensitive.ts",
|
|
61
|
-
"default": "./lib/sensitive.js"
|
|
62
|
-
},
|
|
63
|
-
"./Traits": {
|
|
64
|
-
"types": "./lib/traits.d.ts",
|
|
65
|
-
"bun": "./src/traits.ts",
|
|
66
|
-
"default": "./lib/traits.js"
|
|
64
|
+
"./*": {
|
|
65
|
+
"types": "./lib/services/*.d.ts",
|
|
66
|
+
"bun": "./src/services/*.ts",
|
|
67
|
+
"worker": "./src/services/*.ts",
|
|
68
|
+
"default": "./lib/services/*.js"
|
|
67
69
|
}
|
|
68
70
|
},
|
|
69
71
|
"scripts": {
|
|
70
|
-
"typecheck": "tsc",
|
|
71
72
|
"build": "tsc -b",
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"test": "bunx vitest run test --passWithNoTests",
|
|
76
|
-
"publish:npm": "bun run build && bun publish --access public",
|
|
77
|
-
"generate": "bun run scripts/generate.ts && oxlint --fix src && oxfmt --write src && oxfmt --write src",
|
|
73
|
+
"convert": "bun scripts/convert.ts",
|
|
74
|
+
"generate": "bun scripts/convert.ts && bun scripts/generate.ts",
|
|
75
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
78
76
|
"specs:fetch": "git submodule update --force --init --recursive --depth=1 specs/docs && git -C specs/docs checkout -- .",
|
|
79
77
|
"specs:update": "git -C specs/docs fetch && git -C specs/docs checkout main && git -C specs/docs pull"
|
|
80
78
|
},
|
|
81
79
|
"dependencies": {
|
|
82
|
-
"@distilled.cloud/core": "0.
|
|
80
|
+
"@distilled.cloud/core": "1.0.0-rc.1",
|
|
81
|
+
"@effect/platform-bun": ">=4.0.0-beta.102 || >=4.0.0",
|
|
82
|
+
"effect": ">=4.0.0-beta.102 || >=4.0.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@types/bun": "
|
|
86
|
-
"@types/node": "
|
|
87
|
-
"dotenv": "^16.5.0",
|
|
88
|
-
"rolldown": "^1.2.0",
|
|
89
|
-
"vitest": "^3.2.3"
|
|
90
|
-
},
|
|
91
|
-
"peerDependencies": {
|
|
92
|
-
"effect": ">=4.0.0-beta.100 || >=4.0.0"
|
|
85
|
+
"@types/bun": "latest",
|
|
86
|
+
"@types/node": "latest"
|
|
93
87
|
}
|
|
94
88
|
}
|
package/src/credentials.ts
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Axiom credentials — hand-written.
|
|
3
|
+
*
|
|
4
|
+
* API-compatible port of the distilled v0 axiom credentials module: the
|
|
5
|
+
* `Credentials` service holds an *effect* that resolves the current
|
|
6
|
+
* credentials on every request (the protocol layer resolves it per request
|
|
7
|
+
* on the calling fiber).
|
|
8
|
+
*/
|
|
2
9
|
import * as EffectConfig from "effect/Config";
|
|
3
10
|
import * as Context from "effect/Context";
|
|
4
11
|
import * as Effect from "effect/Effect";
|
|
5
12
|
import * as Layer from "effect/Layer";
|
|
6
13
|
import * as Option from "effect/Option";
|
|
7
14
|
import * as Redacted from "effect/Redacted";
|
|
15
|
+
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
8
16
|
|
|
9
17
|
/** Default base URL for Axiom Cloud. Self-hosted users can override via AXIOM_URL. */
|
|
10
18
|
export const DEFAULT_API_BASE_URL = "https://api.axiom.co";
|
|
@@ -25,6 +33,23 @@ export class Credentials extends Context.Service<
|
|
|
25
33
|
Effect.Effect<Config>
|
|
26
34
|
>()("AxiomCredentials") {}
|
|
27
35
|
|
|
36
|
+
/** Layer from a plain API token + optional base URL / org ID. */
|
|
37
|
+
export const fromApiKey = (config: {
|
|
38
|
+
readonly apiKey: string | Redacted.Redacted<string>;
|
|
39
|
+
readonly apiBaseUrl?: string;
|
|
40
|
+
readonly orgId?: string;
|
|
41
|
+
}): Layer.Layer<Credentials> =>
|
|
42
|
+
Layer.succeed(
|
|
43
|
+
Credentials,
|
|
44
|
+
Effect.succeed({
|
|
45
|
+
apiKey: Redacted.isRedacted(config.apiKey)
|
|
46
|
+
? config.apiKey
|
|
47
|
+
: Redacted.make(config.apiKey),
|
|
48
|
+
apiBaseUrl: config.apiBaseUrl ?? DEFAULT_API_BASE_URL,
|
|
49
|
+
orgId: config.orgId,
|
|
50
|
+
}),
|
|
51
|
+
);
|
|
52
|
+
|
|
28
53
|
const envConfig = EffectConfig.all({
|
|
29
54
|
apiToken: EffectConfig.option(EffectConfig.string("AXIOM_TOKEN")),
|
|
30
55
|
apiKey: EffectConfig.option(EffectConfig.string("AXIOM_API_KEY")),
|
|
@@ -42,7 +67,7 @@ const envConfig = EffectConfig.all({
|
|
|
42
67
|
* regional edge deployments). Defaults to `https://api.axiom.co`.
|
|
43
68
|
* - `AXIOM_ORG_ID` (optional) — organization ID, required for PATs.
|
|
44
69
|
*/
|
|
45
|
-
export const CredentialsFromEnv = Layer.succeed(
|
|
70
|
+
export const CredentialsFromEnv: Layer.Layer<Credentials> = Layer.succeed(
|
|
46
71
|
Credentials,
|
|
47
72
|
Effect.gen(function* () {
|
|
48
73
|
const config = yield* envConfig.pipe(
|
package/src/edge-ingest.ts
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* `@distilled.cloud/axiom/edge-ingest` — the v1 edge ingest API
|
|
3
|
+
* (`ingestToDataset`), served from the same canonical host
|
|
4
|
+
* (https://api.axiom.co) under the `/v1` prefix.
|
|
5
|
+
*/
|
|
6
|
+
export * from "./services/edge_ingest.ts";
|
package/src/edge-query.ts
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* `@distilled.cloud/axiom/edge-query` — the v1 edge query API (`queryApl`),
|
|
3
|
+
* served from the same canonical host (https://api.axiom.co) under the `/v1`
|
|
4
|
+
* prefix.
|
|
5
|
+
*/
|
|
6
|
+
export * from "./services/edge_query.ts";
|
package/src/errors.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Axiom-specific error types.
|
|
3
3
|
*
|
|
4
|
-
* Re-exports common HTTP errors from
|
|
5
|
-
*
|
|
4
|
+
* Re-exports the common HTTP errors from core and adds the Axiom fallback
|
|
5
|
+
* errors. Note the generated service modules additionally define their own
|
|
6
|
+
* per-status matcher classes (BadRequest/NotFound/…) for the statuses each
|
|
7
|
+
* operation declares — those share `_tag`s with the core classes here, so
|
|
8
|
+
* `catchTag` works against either.
|
|
6
9
|
*/
|
|
7
10
|
export {
|
|
8
11
|
BadGateway,
|
|
@@ -27,7 +30,7 @@ export type { DefaultErrors } from "@distilled.cloud/core/errors";
|
|
|
27
30
|
import * as Schema from "effect/Schema";
|
|
28
31
|
import * as Category from "@distilled.cloud/core/category";
|
|
29
32
|
|
|
30
|
-
|
|
33
|
+
/** Unknown Axiom error — returned when nothing else matches the failure. */
|
|
31
34
|
export class UnknownAxiomError extends Schema.TaggedErrorClass<UnknownAxiomError>()(
|
|
32
35
|
"UnknownAxiomError",
|
|
33
36
|
{
|
|
@@ -37,7 +40,7 @@ export class UnknownAxiomError extends Schema.TaggedErrorClass<UnknownAxiomError
|
|
|
37
40
|
},
|
|
38
41
|
).pipe(Category.withServerError) {}
|
|
39
42
|
|
|
40
|
-
|
|
43
|
+
/** Schema parse error wrapper (kept for v0 surface parity). */
|
|
41
44
|
export class AxiomParseError extends Schema.TaggedErrorClass<AxiomParseError>()(
|
|
42
45
|
"AxiomParseError",
|
|
43
46
|
{
|
package/src/index.ts
CHANGED
|
@@ -1,21 +1,43 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Axiom SDK for Effect
|
|
2
|
+
* @distilled.cloud/axiom — Axiom SDK for Effect.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* `./services` is generated by `scripts/generate.ts` from the Smithy models
|
|
5
|
+
* in `.generated-specs` (written by `scripts/convert.ts` from the three
|
|
6
|
+
* OpenAPI specs in specs/docs/restapi/versions). Everything else in this
|
|
7
|
+
* folder is hand-written.
|
|
8
|
+
*
|
|
9
|
+
* The v2 control-plane API lives under `Services.v2`; the v1 edge APIs are
|
|
10
|
+
* also available under their own subpath imports:
|
|
6
11
|
*
|
|
7
12
|
* @example
|
|
8
|
-
*
|
|
9
|
-
* import * as
|
|
13
|
+
* ```ts
|
|
14
|
+
* import * as Axiom from "@distilled.cloud/axiom";
|
|
10
15
|
* import * as EdgeIngest from "@distilled.cloud/axiom/edge-ingest";
|
|
11
16
|
* import * as EdgeQuery from "@distilled.cloud/axiom/edge-query";
|
|
12
|
-
*
|
|
17
|
+
*
|
|
18
|
+
* const datasets = yield* Axiom.Services.v2.getDatasets({});
|
|
19
|
+
* ```
|
|
13
20
|
*/
|
|
14
21
|
export * from "./credentials.ts";
|
|
15
|
-
export *
|
|
22
|
+
export * from "./errors.ts";
|
|
16
23
|
export * as T from "./traits.ts";
|
|
24
|
+
export {
|
|
25
|
+
AxiomProtocol,
|
|
26
|
+
stripNulls,
|
|
27
|
+
type AxiomOpError,
|
|
28
|
+
type AxiomOpContext,
|
|
29
|
+
} from "./protocol.ts";
|
|
17
30
|
export * as Retry from "./retry.ts";
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
31
|
+
export * as Services from "./services/index.ts";
|
|
32
|
+
// v0-parity surface: the v2 control-plane operations live on the package
|
|
33
|
+
// root (edge-ingest / edge-query stay behind their subpath exports).
|
|
34
|
+
// The service-local typed error classes shadow the same-named shared ones
|
|
35
|
+
// from ./errors.ts — the ops actually raise the service-local classes.
|
|
36
|
+
export * from "./services/v2.ts";
|
|
37
|
+
export {
|
|
38
|
+
BadRequest,
|
|
39
|
+
Conflict,
|
|
40
|
+
Forbidden,
|
|
41
|
+
NotFound,
|
|
42
|
+
UnprocessableEntity,
|
|
43
|
+
} from "./services/v2.ts";
|
package/src/protocol.ts
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AxiomProtocol — hand-written.
|
|
3
|
+
*
|
|
4
|
+
* Axiom speaks plain bearer-authenticated JSON REST (no response envelope),
|
|
5
|
+
* so the whole protocol is one `makeRestProtocol` call from
|
|
6
|
+
* `core/protocol-rest`:
|
|
7
|
+
*
|
|
8
|
+
* request: credentials → `Authorization: Bearer <apiKey>` (+ optional
|
|
9
|
+
* `X-Axiom-Org-ID` for Personal Access Tokens) + base URL
|
|
10
|
+
* (default https://api.axiom.co), resolved from the calling
|
|
11
|
+
* fiber on every request
|
|
12
|
+
*
|
|
13
|
+
* response: 2xx JSON is the payload, with explicit JSON `null` properties
|
|
14
|
+
* recursively dropped first ({@link stripNulls} — Axiom's Go
|
|
15
|
+
* backend serializes nil slices/omitted optionals as `null`);
|
|
16
|
+
* non-2xx bodies map to the operation's typed error classes by
|
|
17
|
+
* status, then the shared HTTP-status classes, then
|
|
18
|
+
* {@link UnknownAxiomError}. Axiom returns two error envelope
|
|
19
|
+
* shapes — `{ code, message }` (control-plane / edge-ingest) and
|
|
20
|
+
* `{ error, message }` (edge-query) — unified by a lenient
|
|
21
|
+
* extractor; the HTTP status stays the authoritative signal.
|
|
22
|
+
*/
|
|
23
|
+
import * as Effect from "effect/Effect";
|
|
24
|
+
import type * as Layer from "effect/Layer";
|
|
25
|
+
import * as Redacted from "effect/Redacted";
|
|
26
|
+
import type * as HttpClient from "effect/unstable/http/HttpClient";
|
|
27
|
+
import type * as HttpClientError from "effect/unstable/http/HttpClientError";
|
|
28
|
+
import type * as API from "@distilled.cloud/core/api";
|
|
29
|
+
import {
|
|
30
|
+
makeRestProtocol,
|
|
31
|
+
type RestErrorEnvelope,
|
|
32
|
+
} from "@distilled.cloud/core/protocol-rest";
|
|
33
|
+
import type { API_ERRORS, ConfigError } from "@distilled.cloud/core/errors";
|
|
34
|
+
import { Credentials, type Config } from "./credentials.ts";
|
|
35
|
+
import { UnknownAxiomError } from "./errors.ts";
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Error channel shared by every generated Axiom operation. Generated service
|
|
39
|
+
* files annotate operations with `API.OperationMethod<I, O, AxiomOpError,
|
|
40
|
+
* AxiomOpContext>` explicitly so the compiler never infers these back out of
|
|
41
|
+
* the schema generics.
|
|
42
|
+
*/
|
|
43
|
+
export type AxiomOpError =
|
|
44
|
+
| InstanceType<(typeof API_ERRORS)[number]>
|
|
45
|
+
| UnknownAxiomError
|
|
46
|
+
| ConfigError
|
|
47
|
+
| HttpClientError.HttpClientError;
|
|
48
|
+
|
|
49
|
+
/** Context (requirements) shared by every generated Axiom operation. */
|
|
50
|
+
export type AxiomOpContext = Credentials | HttpClient.HttpClient;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Axiom's backend (Go) serializes nil slices and omitted optional fields as
|
|
54
|
+
* JSON `null`. The generated output schemas model these as optional members
|
|
55
|
+
* (value or absent), so `null` trips decoding. Recursively drop explicit
|
|
56
|
+
* `null` properties before decoding so optional fields are treated as
|
|
57
|
+
* absent. Keys that are genuinely nullable in the API are patched to
|
|
58
|
+
* nullable in the spec — this hook exists for the far more common "Go nil
|
|
59
|
+
* slice" case.
|
|
60
|
+
*/
|
|
61
|
+
export const stripNulls = (value: unknown): unknown => {
|
|
62
|
+
if (Array.isArray(value)) return value.map(stripNulls);
|
|
63
|
+
if (value && typeof value === "object") {
|
|
64
|
+
const out: Record<string, unknown> = {};
|
|
65
|
+
for (const [k, v] of Object.entries(value as Record<string, unknown>)) {
|
|
66
|
+
if (v === null) continue;
|
|
67
|
+
out[k] = stripNulls(v);
|
|
68
|
+
}
|
|
69
|
+
return out;
|
|
70
|
+
}
|
|
71
|
+
return value;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Unify Axiom's two error envelope shapes (`{ code, message }` and
|
|
76
|
+
* `{ error, message }`, some endpoints plain `{ message }`) into one
|
|
77
|
+
* `{ code?, message? }` pair — v0 semantics: `message ?? error`,
|
|
78
|
+
* `code ?? error`.
|
|
79
|
+
*/
|
|
80
|
+
const errorEnvelope = (body: unknown): RestErrorEnvelope | undefined => {
|
|
81
|
+
if (body === null || typeof body !== "object") return undefined;
|
|
82
|
+
const b = body as Record<string, unknown>;
|
|
83
|
+
const error = typeof b.error === "string" ? b.error : undefined;
|
|
84
|
+
const code =
|
|
85
|
+
typeof b.code === "string" || typeof b.code === "number" ? b.code : error;
|
|
86
|
+
const message = typeof b.message === "string" ? b.message : error;
|
|
87
|
+
return { code, message };
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export const AxiomProtocol: Layer.Layer<API.Protocol> =
|
|
91
|
+
makeRestProtocol<Config>({
|
|
92
|
+
// The Credentials service holds an effect — resolving it here (per
|
|
93
|
+
// request, on the calling fiber) picks up context-provided credentials.
|
|
94
|
+
credentials: Effect.gen(function* () {
|
|
95
|
+
const resolve = yield* Credentials;
|
|
96
|
+
return yield* resolve;
|
|
97
|
+
}),
|
|
98
|
+
baseUrl: (creds) => creds.apiBaseUrl,
|
|
99
|
+
headers: (creds) => ({
|
|
100
|
+
Authorization: `Bearer ${Redacted.value(creds.apiKey)}`,
|
|
101
|
+
...(creds.orgId ? { "X-Axiom-Org-ID": creds.orgId } : {}),
|
|
102
|
+
}),
|
|
103
|
+
errorEnvelope,
|
|
104
|
+
transformResponse: stripNulls,
|
|
105
|
+
unknownError: ({ code, message, body }) =>
|
|
106
|
+
new UnknownAxiomError({
|
|
107
|
+
code: typeof code === "number" ? String(code) : code,
|
|
108
|
+
message,
|
|
109
|
+
body,
|
|
110
|
+
}),
|
|
111
|
+
});
|
package/src/retry.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Axiom retry configuration.
|
|
3
3
|
*
|
|
4
|
-
* Defines the per-SDK `Retry` Context.Service tag that
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* Axiom API call below it pick it up:
|
|
4
|
+
* Defines the per-SDK `Retry` Context.Service tag that generated operations
|
|
5
|
+
* wire into `API.make`. Callers can install a blanket retry policy at the
|
|
6
|
+
* layer level and have every Axiom API call below it pick it up:
|
|
8
7
|
*
|
|
9
8
|
* @example
|
|
10
9
|
* ```ts
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/docs restapi/versions). Do not edit.
|
|
2
|
+
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
+
import * as API from "@distilled.cloud/core/api";
|
|
4
|
+
import * as T from "../traits.ts";
|
|
5
|
+
import {
|
|
6
|
+
AxiomProtocol,
|
|
7
|
+
type AxiomOpError,
|
|
8
|
+
type AxiomOpContext,
|
|
9
|
+
} from "../protocol.ts";
|
|
10
|
+
import { UnknownAxiomError } from "../errors.ts";
|
|
11
|
+
import * as Retry from "../retry.ts";
|
|
12
|
+
|
|
13
|
+
export type { AxiomOpError, AxiomOpContext };
|
|
14
|
+
|
|
15
|
+
export class BadRequest
|
|
16
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
17
|
+
/*@__PURE__*/ S.TaggedErrorClass<BadRequest>()("BadRequest", {
|
|
18
|
+
code: S.Number,
|
|
19
|
+
message: S.String,
|
|
20
|
+
}),
|
|
21
|
+
[{ status: 400 }],
|
|
22
|
+
) {}
|
|
23
|
+
|
|
24
|
+
export class NotFound
|
|
25
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
26
|
+
/*@__PURE__*/ S.TaggedErrorClass<NotFound>()("NotFound", {
|
|
27
|
+
code: S.Number,
|
|
28
|
+
message: S.String,
|
|
29
|
+
}),
|
|
30
|
+
[{ status: 404 }],
|
|
31
|
+
) {}
|
|
32
|
+
|
|
33
|
+
export class UnprocessableEntity
|
|
34
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
35
|
+
/*@__PURE__*/ S.TaggedErrorClass<UnprocessableEntity>()(
|
|
36
|
+
"UnprocessableEntity",
|
|
37
|
+
{
|
|
38
|
+
code: S.Number,
|
|
39
|
+
message: S.String,
|
|
40
|
+
},
|
|
41
|
+
),
|
|
42
|
+
[{ status: 422 }],
|
|
43
|
+
) {}
|
|
44
|
+
|
|
45
|
+
export interface IngestToDatasetRequest {
|
|
46
|
+
dataset_id: string;
|
|
47
|
+
/** The name of the field to use as the timestamp. If not specified, the timestamp will be the time the event was received by Axiom. */
|
|
48
|
+
timestamp_field?: string;
|
|
49
|
+
/** The date-time format of the timestamp field. The reference time is `Mon Jan 2 15:04:05 -0700 MST 2006`, as specified in https://pkg.go.dev/time/?tab=doc#Parse */
|
|
50
|
+
timestamp_format?: string;
|
|
51
|
+
/** The delimiter to use when parsing CSV data. If not specified, the default delimiter is `,`. */
|
|
52
|
+
csv_delimiter?: string;
|
|
53
|
+
body: string;
|
|
54
|
+
}
|
|
55
|
+
export const IngestToDatasetRequest = /*@__PURE__*/ S.suspend(() =>
|
|
56
|
+
S.Struct({
|
|
57
|
+
dataset_id: S.String.pipe(T.Label()),
|
|
58
|
+
timestamp_field: S.optional(S.String.pipe(T.Query("timestamp-field"))),
|
|
59
|
+
timestamp_format: S.optional(S.String.pipe(T.Query("timestamp-format"))),
|
|
60
|
+
csv_delimiter: S.optional(S.String.pipe(T.Query("csv-delimiter"))),
|
|
61
|
+
body: S.String.pipe(T.HttpBody()),
|
|
62
|
+
}).pipe(
|
|
63
|
+
T.Http({
|
|
64
|
+
method: "POST",
|
|
65
|
+
uri: "/v1/datasets/{dataset_id}/ingest",
|
|
66
|
+
code: 200,
|
|
67
|
+
}),
|
|
68
|
+
),
|
|
69
|
+
).annotate({
|
|
70
|
+
identifier: "IngestToDatasetRequest",
|
|
71
|
+
}) as any as S.Schema<IngestToDatasetRequest>;
|
|
72
|
+
|
|
73
|
+
export interface IngestFailure {
|
|
74
|
+
error: string;
|
|
75
|
+
timestamp: string;
|
|
76
|
+
}
|
|
77
|
+
export const IngestFailure = /*@__PURE__*/ S.suspend(() =>
|
|
78
|
+
S.Struct({
|
|
79
|
+
error: S.String,
|
|
80
|
+
timestamp: S.String,
|
|
81
|
+
}),
|
|
82
|
+
).annotate({ identifier: "IngestFailure" }) as any as S.Schema<IngestFailure>;
|
|
83
|
+
|
|
84
|
+
export type IngestStatusFailuresList = Array<IngestFailure>;
|
|
85
|
+
export const IngestStatusFailuresList = /*@__PURE__*/ S.Array(
|
|
86
|
+
IngestFailure,
|
|
87
|
+
) as any as S.Schema<IngestStatusFailuresList>;
|
|
88
|
+
|
|
89
|
+
export interface IngestStatus {
|
|
90
|
+
blocksCreated: number;
|
|
91
|
+
failed: number;
|
|
92
|
+
failures?: IngestStatusFailuresList;
|
|
93
|
+
ingested: number;
|
|
94
|
+
processedBytes: number;
|
|
95
|
+
walLength: number;
|
|
96
|
+
}
|
|
97
|
+
export const IngestStatus = /*@__PURE__*/ S.suspend(() =>
|
|
98
|
+
S.Struct({
|
|
99
|
+
blocksCreated: S.Number,
|
|
100
|
+
failed: S.Number,
|
|
101
|
+
failures: S.optional(IngestStatusFailuresList),
|
|
102
|
+
ingested: S.Number,
|
|
103
|
+
processedBytes: S.Number,
|
|
104
|
+
walLength: S.Number,
|
|
105
|
+
}),
|
|
106
|
+
).annotate({ identifier: "IngestStatus" }) as any as S.Schema<IngestStatus>;
|
|
107
|
+
|
|
108
|
+
export type IngestToDatasetError =
|
|
109
|
+
| BadRequest
|
|
110
|
+
| NotFound
|
|
111
|
+
| UnprocessableEntity
|
|
112
|
+
| AxiomOpError;
|
|
113
|
+
export const ingestToDataset: API.OperationMethod<
|
|
114
|
+
IngestToDatasetRequest,
|
|
115
|
+
IngestStatus,
|
|
116
|
+
IngestToDatasetError,
|
|
117
|
+
AxiomOpContext
|
|
118
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
119
|
+
input: IngestToDatasetRequest,
|
|
120
|
+
output: IngestStatus,
|
|
121
|
+
errors: [BadRequest, NotFound, UnprocessableEntity, UnknownAxiomError],
|
|
122
|
+
protocol: AxiomProtocol,
|
|
123
|
+
retry: Retry.Retry,
|
|
124
|
+
}));
|