@devvit/shared-types 0.11.0-next-2024-07-16-9c3bb9dc1.0 → 0.11.0-next-2024-07-17-cfa29152f.0

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devvit/shared-types",
3
- "version": "0.11.0-next-2024-07-16-9c3bb9dc1.0",
3
+ "version": "0.11.0-next-2024-07-17-cfa29152f.0",
4
4
  "license": "BSD-3-Clause",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,14 +24,16 @@
24
24
  },
25
25
  "types": "./index.d.ts",
26
26
  "dependencies": {
27
- "@devvit/protos": "0.11.0-next-2024-07-16-9c3bb9dc1.0",
28
- "jsonschema": "1.4.1"
27
+ "@devvit/protos": "0.11.0-next-2024-07-17-cfa29152f.0",
28
+ "jsonschema": "1.4.1",
29
+ "uuid": "9.0.0"
29
30
  },
30
31
  "devDependencies": {
31
- "@devvit/eslint-config": "0.11.0-next-2024-07-16-9c3bb9dc1.0",
32
- "@devvit/repo-tools": "0.11.0-next-2024-07-16-9c3bb9dc1.0",
33
- "@devvit/tsconfig": "0.11.0-next-2024-07-16-9c3bb9dc1.0",
32
+ "@devvit/eslint-config": "0.11.0-next-2024-07-17-cfa29152f.0",
33
+ "@devvit/repo-tools": "0.11.0-next-2024-07-17-cfa29152f.0",
34
+ "@devvit/tsconfig": "0.11.0-next-2024-07-17-cfa29152f.0",
34
35
  "@types/redis-mock": "0.17.1",
36
+ "@types/uuid": "9.0.0",
35
37
  "eslint": "8.9.0",
36
38
  "lit": "2.2.8",
37
39
  "redis": "4.6.6",
@@ -43,5 +45,5 @@
43
45
  "directory": "dist"
44
46
  },
45
47
  "source": "./src/index.ts",
46
- "gitHead": "c6a5dd7ea73dd164d70ecc546609be491467fe40"
48
+ "gitHead": "78e9e31bd2496de550499ca68eb71dfed0d3352d"
47
49
  }
@@ -19,4 +19,5 @@ export type Product = {
19
19
  * Converts an Product protobuf message to an Product object.
20
20
  */
21
21
  export declare function productFromProto(data: ProductProto): Product;
22
+ export declare function newProductId(appVersionId: string, productSku: string): string;
22
23
  //# sourceMappingURL=Product.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Product.d.ts","sourceRoot":"","sources":["../../src/payments/Product.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1E;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC;AAEzB;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAQ5D"}
1
+ {"version":3,"file":"Product.d.ts","sourceRoot":"","sources":["../../src/payments/Product.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI1E;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC;AAEzB;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB,GAAG,EAAE,GAAG,CAAC;IACT,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAQ5D;AAED,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAI7E"}
@@ -1,4 +1,5 @@
1
1
  import { assertNonNull } from '../NonNull.js';
2
+ import { v5 as uuidv5 } from 'uuid';
2
3
  /**
3
4
  * Converts an Product protobuf message to an Product object.
4
5
  */
@@ -11,3 +12,8 @@ export function productFromProto(data) {
11
12
  metadata: data.productMetadata,
12
13
  };
13
14
  }
15
+ export function newProductId(appVersionId, productSku) {
16
+ const uuidV5Name = productSku;
17
+ const uuidV5Namespace = appVersionId;
18
+ return uuidv5(uuidV5Name, uuidV5Namespace);
19
+ }