@devvit/shared-types 0.11.0-next-2024-07-16-6c1ae0e68.0 → 0.11.0-next-2024-07-17-0476f4bc1.0

Sign up to get free protection for your applications and to get access to all the features.
package/Header.d.ts CHANGED
@@ -27,6 +27,7 @@ export declare const Header: Readonly<{
27
27
  Language: "devvit-accept-language";
28
28
  Timezone: "devvit-accept-timezone";
29
29
  AppDependencies: "devvit-app-dependencies";
30
+ WebviewTemplate: "devvit-webview-template";
30
31
  }>;
31
32
  export type Header = (typeof Header)[keyof typeof Header];
32
33
  /** See DevvitGlobal and ContextDebugInfo. */
package/Header.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../src/Header.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;EAwBjB,CAAC;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,CAAC;AAE1D,6CAA6C;AAC7C,0BAAkB,QAAQ;IACxB,uCAAuC;IACvC,MAAM,WAAW;IACjB;;;;OAIG;IACH,aAAa,kBAAkB;IAC/B,6BAA6B;IAC7B,SAAS,cAAc;IACvB,+DAA+D;IAC/D,QAAQ,aAAa;IACrB,6CAA6C;IAC7C,OAAO,YAAY;IACnB,8DAA8D;IAC9D,OAAO,YAAY;IACnB,2DAA2D;IAC3D,QAAQ,aAAa;CACtB"}
1
+ {"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../src/Header.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;EAyBjB,CAAC;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,OAAO,MAAM,CAAC,CAAC;AAE1D,6CAA6C;AAC7C,0BAAkB,QAAQ;IACxB,uCAAuC;IACvC,MAAM,WAAW;IACjB;;;;OAIG;IACH,aAAa,kBAAkB;IAC/B,6BAA6B;IAC7B,SAAS,cAAc;IACvB,+DAA+D;IAC/D,QAAQ,aAAa;IACrB,6CAA6C;IAC7C,OAAO,YAAY;IACnB,8DAA8D;IAC9D,OAAO,YAAY;IACnB,2DAA2D;IAC3D,QAAQ,aAAa;CACtB"}
package/Header.js CHANGED
@@ -27,6 +27,7 @@ export const Header = Object.freeze({
27
27
  Language: 'devvit-accept-language',
28
28
  Timezone: 'devvit-accept-timezone',
29
29
  AppDependencies: 'devvit-app-dependencies',
30
+ WebviewTemplate: 'devvit-webview-template',
30
31
  });
31
32
  /** See DevvitGlobal and ContextDebugInfo. */
32
33
  export var AppDebug;
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-6c1ae0e68.0",
3
+ "version": "0.11.0-next-2024-07-17-0476f4bc1.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-6c1ae0e68.0",
28
- "jsonschema": "1.4.1"
27
+ "@devvit/protos": "0.11.0-next-2024-07-17-0476f4bc1.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-6c1ae0e68.0",
32
- "@devvit/repo-tools": "0.11.0-next-2024-07-16-6c1ae0e68.0",
33
- "@devvit/tsconfig": "0.11.0-next-2024-07-16-6c1ae0e68.0",
32
+ "@devvit/eslint-config": "0.11.0-next-2024-07-17-0476f4bc1.0",
33
+ "@devvit/repo-tools": "0.11.0-next-2024-07-17-0476f4bc1.0",
34
+ "@devvit/tsconfig": "0.11.0-next-2024-07-17-0476f4bc1.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": "9a760931273d57ac292ae1f9c15682f7c61cb8fc"
48
+ "gitHead": "768a56f381d2b8710c78f80f1ace6104b60205fc"
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
+ }