@certik/skynet 0.22.1 → 0.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/.vscode/settings.json +5 -0
  2. package/CHANGELOG.md +4 -0
  3. package/build.ts +23 -0
  4. package/bun.lockb +0 -0
  5. package/dist/abi.d.ts +1 -2
  6. package/dist/abi.js +569 -563
  7. package/dist/address.d.ts +0 -1
  8. package/dist/address.js +22 -21
  9. package/dist/api.d.ts +0 -1
  10. package/dist/api.js +235 -120
  11. package/dist/app.d.ts +1 -2
  12. package/dist/app.js +2030 -276
  13. package/dist/availability.d.ts +0 -1
  14. package/dist/availability.js +126 -56
  15. package/dist/cli.d.ts +0 -1
  16. package/dist/cli.js +28 -24
  17. package/dist/const.d.ts +0 -1
  18. package/dist/const.js +153 -132
  19. package/dist/databricks.d.ts +0 -1
  20. package/dist/databricks.js +198 -58
  21. package/dist/date.d.ts +0 -1
  22. package/dist/date.js +48 -21
  23. package/dist/deploy.d.ts +0 -1
  24. package/dist/deploy.js +427 -292
  25. package/dist/dynamodb.d.ts +3 -4
  26. package/dist/dynamodb.js +432 -281
  27. package/dist/env.d.ts +2 -3
  28. package/dist/env.js +16 -9
  29. package/dist/graphql.d.ts +0 -1
  30. package/dist/graphql.js +26 -23
  31. package/dist/indexer.d.ts +0 -1
  32. package/dist/indexer.js +1050 -441
  33. package/dist/log.d.ts +0 -1
  34. package/dist/log.js +53 -52
  35. package/dist/object-hash.d.ts +0 -1
  36. package/dist/object-hash.js +49 -59
  37. package/dist/opsgenie.d.ts +1 -1
  38. package/dist/opsgenie.js +31 -30
  39. package/dist/por.d.ts +0 -1
  40. package/dist/por.js +113 -123
  41. package/dist/s3.d.ts +7 -8
  42. package/dist/s3.js +103 -91
  43. package/dist/search.d.ts +0 -1
  44. package/dist/search.js +100 -25
  45. package/dist/selector.d.ts +0 -1
  46. package/dist/selector.js +34 -38
  47. package/dist/slack.d.ts +0 -1
  48. package/dist/slack.js +27 -21
  49. package/dist/util.d.ts +0 -1
  50. package/dist/util.js +21 -20
  51. package/examples/api.ts +1 -1
  52. package/examples/indexer.ts +1 -1
  53. package/examples/mode-indexer.ts +1 -1
  54. package/package.json +5 -4
  55. package/{graphql.ts → src/graphql.ts} +1 -1
  56. package/{opsgenie.ts → src/opsgenie.ts} +2 -1
  57. package/tsconfig.build.json +2 -5
  58. package/tsconfig.json +11 -20
  59. package/dist/abi.d.ts.map +0 -1
  60. package/dist/address.d.ts.map +0 -1
  61. package/dist/api.d.ts.map +0 -1
  62. package/dist/app.d.ts.map +0 -1
  63. package/dist/availability.d.ts.map +0 -1
  64. package/dist/cli.d.ts.map +0 -1
  65. package/dist/const.d.ts.map +0 -1
  66. package/dist/databricks.d.ts.map +0 -1
  67. package/dist/date.d.ts.map +0 -1
  68. package/dist/deploy.d.ts.map +0 -1
  69. package/dist/dynamodb.d.ts.map +0 -1
  70. package/dist/env.d.ts.map +0 -1
  71. package/dist/graphql.d.ts.map +0 -1
  72. package/dist/indexer.d.ts.map +0 -1
  73. package/dist/log.d.ts.map +0 -1
  74. package/dist/object-hash.d.ts.map +0 -1
  75. package/dist/opsgenie.d.ts.map +0 -1
  76. package/dist/por.d.ts.map +0 -1
  77. package/dist/s3.d.ts.map +0 -1
  78. package/dist/search.d.ts.map +0 -1
  79. package/dist/selector.d.ts.map +0 -1
  80. package/dist/slack.d.ts.map +0 -1
  81. package/dist/util.d.ts.map +0 -1
  82. /package/{abi.ts → src/abi.ts} +0 -0
  83. /package/{address.ts → src/address.ts} +0 -0
  84. /package/{api.ts → src/api.ts} +0 -0
  85. /package/{app.ts → src/app.ts} +0 -0
  86. /package/{availability.ts → src/availability.ts} +0 -0
  87. /package/{cli.ts → src/cli.ts} +0 -0
  88. /package/{const.ts → src/const.ts} +0 -0
  89. /package/{databricks.ts → src/databricks.ts} +0 -0
  90. /package/{date.ts → src/date.ts} +0 -0
  91. /package/{deploy.ts → src/deploy.ts} +0 -0
  92. /package/{dynamodb.ts → src/dynamodb.ts} +0 -0
  93. /package/{env.ts → src/env.ts} +0 -0
  94. /package/{indexer.ts → src/indexer.ts} +0 -0
  95. /package/{log.ts → src/log.ts} +0 -0
  96. /package/{object-hash.ts → src/object-hash.ts} +0 -0
  97. /package/{por.ts → src/por.ts} +0 -0
  98. /package/{s3.ts → src/s3.ts} +0 -0
  99. /package/{search.ts → src/search.ts} +0 -0
  100. /package/{selector.ts → src/selector.ts} +0 -0
  101. /package/{slack.ts → src/slack.ts} +0 -0
  102. /package/{util.ts → src/util.ts} +0 -0
package/dist/env.d.ts CHANGED
@@ -1,7 +1,6 @@
1
- declare function ensureAndGet(envName: string, defaultValue?: string): string;
2
- declare function getEnvironment(): string;
1
+ declare function ensureAndGet(envName: string, defaultValue?: string): string | undefined;
2
+ declare function getEnvironment(): string | undefined;
3
3
  declare function getEnvOrThrow(envName: string): string;
4
4
  declare function isProduction(): boolean;
5
5
  declare function isDev(): boolean;
6
6
  export { ensureAndGet, getEnvOrThrow, getEnvironment, isProduction, isDev };
7
- //# sourceMappingURL=env.d.ts.map
package/dist/env.js CHANGED
@@ -1,19 +1,26 @@
1
+ // src/env.ts
1
2
  function ensureAndGet(envName, defaultValue) {
2
- return process.env[envName] || defaultValue;
3
+ return process.env[envName] || defaultValue;
3
4
  }
4
5
  function getEnvironment() {
5
- return ensureAndGet("SKYNET_ENVIRONMENT", "dev");
6
+ return ensureAndGet("SKYNET_ENVIRONMENT", "dev");
6
7
  }
7
8
  function getEnvOrThrow(envName) {
8
- if (!process.env[envName]) {
9
- throw new Error(`Must set environment variable ${envName}`);
10
- }
11
- return process.env[envName];
9
+ if (!process.env[envName]) {
10
+ throw new Error(`Must set environment variable ${envName}`);
11
+ }
12
+ return process.env[envName];
12
13
  }
13
14
  function isProduction() {
14
- return getEnvironment() === "prd";
15
+ return getEnvironment() === "prd";
15
16
  }
16
17
  function isDev() {
17
- return getEnvironment() === "dev";
18
+ return getEnvironment() === "dev";
18
19
  }
19
- export { ensureAndGet, getEnvOrThrow, getEnvironment, isProduction, isDev };
20
+ export {
21
+ isProduction,
22
+ isDev,
23
+ getEnvironment,
24
+ getEnvOrThrow,
25
+ ensureAndGet
26
+ };
package/dist/graphql.d.ts CHANGED
@@ -3,4 +3,3 @@ type GraphqlVariables = {
3
3
  };
4
4
  export declare function gql<T>(query: string, variables?: GraphqlVariables): Promise<T>;
5
5
  export {};
6
- //# sourceMappingURL=graphql.d.ts.map
package/dist/graphql.js CHANGED
@@ -1,25 +1,28 @@
1
- export async function gql(query, variables = {}) {
2
- const endpoint = process.env["SKYNET_GRAPHQL_ENDPOINT"];
3
- const apiKey = process.env["SKYNET_GRAPHQL_API_KEY"];
4
- if (!endpoint || !apiKey) {
5
- throw new Error("SKYNET_GRAPHQL_ENDPOINT or SKYNET_GRAPHQL_API_KEY is not set");
6
- }
7
- const res = await fetch(endpoint, {
8
- method: "POST",
9
- headers: {
10
- "x-api-key": apiKey,
11
- "content-type": "application/json",
12
- },
13
- body: JSON.stringify({ query: query.trim(), variables }),
14
- });
15
- if (res.ok) {
16
- const { data, errors } = await res.json();
17
- if (errors && errors.length > 0) {
18
- throw new Error(JSON.stringify(errors, null, 2));
19
- }
20
- return data;
21
- }
22
- else {
23
- throw new Error(await res.text());
1
+ // src/graphql.ts
2
+ async function gql(query, variables = {}) {
3
+ const endpoint = process.env["SKYNET_GRAPHQL_ENDPOINT"];
4
+ const apiKey = process.env["SKYNET_GRAPHQL_API_KEY"];
5
+ if (!endpoint || !apiKey) {
6
+ throw new Error("SKYNET_GRAPHQL_ENDPOINT or SKYNET_GRAPHQL_API_KEY is not set");
7
+ }
8
+ const res = await fetch(endpoint, {
9
+ method: "POST",
10
+ headers: {
11
+ "x-api-key": apiKey,
12
+ "content-type": "application/json"
13
+ },
14
+ body: JSON.stringify({ query: query.trim(), variables })
15
+ });
16
+ if (res.ok) {
17
+ const { data, errors } = await res.json();
18
+ if (errors && errors.length > 0) {
19
+ throw new Error(JSON.stringify(errors, null, 2));
24
20
  }
21
+ return data;
22
+ } else {
23
+ throw new Error(await res.text());
24
+ }
25
25
  }
26
+ export {
27
+ gql
28
+ };
package/dist/indexer.d.ts CHANGED
@@ -67,4 +67,3 @@ declare function createIndexerApp<TSelector extends Selector>({ binaryName, sele
67
67
  };
68
68
  export { increaseId, createModeIndexerApp, createIndexerApp };
69
69
  export type { IndexerStateValue, State, StatelessBuildFunction, ModeBuildFunction, ValidateFunction };
70
- //# sourceMappingURL=indexer.d.ts.map